Compare commits
54 Commits
fe6bbb8d2a
...
add_icd10_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d40e1c7bf | ||
|
|
46525e5622 | ||
|
|
2716f15cbe | ||
|
|
8caa27b436 | ||
|
|
9d1c478831 | ||
| 979ce1a40d | |||
|
|
a2915d659f | ||
|
|
075d809d8e | ||
|
|
b6f130e8fa | ||
|
|
e8d08ac4c1 | ||
|
|
139a7b4aa7 | ||
|
|
fe2f5df843 | ||
|
|
6bcf188186 | ||
|
|
d71a4ee7a8 | ||
|
|
9d060cfcda | ||
|
|
8d01bd99b2 | ||
|
|
e3cd87c2c5 | ||
|
|
c889ee6ec2 | ||
|
|
afc4636bc3 | ||
|
|
18d054b6b0 | ||
|
|
d61f1d145a | ||
|
|
93f5a3a815 | ||
|
|
69c2306a3b | ||
|
|
f5365876fe | ||
|
|
1e24cc78c1 | ||
|
|
ba2077894e | ||
|
|
2cb6af7f62 | ||
|
|
a5913ced60 | ||
|
|
cda6c682ce | ||
|
|
017567827e | ||
|
|
0d0085acc6 | ||
|
|
70ca252c34 | ||
|
|
9818d6aa79 | ||
|
|
209d7b0b4c | ||
|
|
1040655ea8 | ||
|
|
873c47760d | ||
|
|
b0320b4d1c | ||
|
|
1ae18eaf31 | ||
|
|
da8e0a7636 | ||
|
|
e7697f7827 | ||
|
|
03be0718a4 | ||
|
|
f6bca9d550 | ||
|
|
72f3b7c09c | ||
|
|
b6969acc37 | ||
|
|
85f8b0fae0 | ||
|
|
a6a1d4edf3 | ||
|
|
ffe422f657 | ||
|
|
3ed2b11016 | ||
|
|
a6adb4ce44 | ||
|
|
ef28d9b17a | ||
|
|
5207eec99a | ||
|
|
33e111b7b5 | ||
|
|
30f09c353c | ||
| 09ee0fd533 |
5
.githooks/post-push
Executable file
5
.githooks/post-push
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
repo_root=$(git rev-parse --show-toplevel)
|
||||
"$repo_root/scripts/devcpone_sync.sh"
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.claude/
|
||||
33
AGENTS.md
Normal file
33
AGENTS.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# AGENTS.md
|
||||
|
||||
## Working Style
|
||||
- Prioritaskan solusi paling sederhana yang langsung menyelesaikan masalah.
|
||||
- Jangan over-engineer, jangan tambah logic/fitur di luar scope request.
|
||||
- Kalau ada opsi cepat dan aman, pilih itu dulu sebelum pendekatan kompleks.
|
||||
- Hindari perubahan banyak sekaligus; lakukan minimal change yang terukur.
|
||||
- Tujuan utama: jangan bikin error baru saat memperbaiki error lama.
|
||||
|
||||
## FE Skills Focus
|
||||
- Utamakan praktik yang rapi dan konsisten untuk `Vue.js` (Options API sesuai pola existing project).
|
||||
- Untuk pekerjaan front-end, fokus pada perbaikan perilaku UI/state terlebih dulu sebelum refactor besar.
|
||||
- Untuk `Vuetify`, ikuti pola komponen yang sudah ada di module terkait (jangan ganti gaya/arsitektur tanpa diminta).
|
||||
- Saat bug UI/network, cek dulu alur `mounted`, `watch`, `computed`, dan `store dispatch` sebelum menambah mekanisme baru.
|
||||
- Jika diminta meniru modul referensi, ikuti pola modul referensi secara ketat.
|
||||
|
||||
## Git Flow (Saat Diminta Commit/Push)
|
||||
- Inspeksi minimal: jalankan `git status` dan `git diff --stat` dulu.
|
||||
- **Sebelum membuat commit, selalu tanya kode task kepada user.**
|
||||
- Format commit message wajib: `TASKCODE - deskripsi singkat`
|
||||
- Contoh: `6D9QD6 - buat api baru`
|
||||
- Jangan buat commit tanpa kode task dari user.
|
||||
- Kode task digunakan untuk sinkronisasi timesheet Odoo.
|
||||
- Sebelum push atau menyiapkan merge branch kerja, selalu cek base branch remote yang benar terlebih dahulu, lalu jalankan `git fetch origin` dan `git rebase` ke base remote tersebut agar conflict muncul lebih awal dan proses merge lebih minim error.
|
||||
- Push branch kerja ke remote lalu buat merge request ke `main`; proses merge ikuti permission dan alur review repo, jangan direct push ke `main` kecuali diminta eksplisit.
|
||||
- Jangan pernah melakukan `git push --force` atau varian force-push lain.
|
||||
- Lalu `git push` tanpa kerja tambahan yang tidak diperlukan.
|
||||
|
||||
## Auto Sync ke Devcpone
|
||||
- Repo ini punya **post-commit hook** di `.githooks/post-commit` yang otomatis menjalankan `scripts/devcpone_sync.sh`.
|
||||
- Setiap `git commit` di branch `master` atau `staging` akan langsung rsync file yang berubah ke `devcpone.aplikasi.web.id:/home/one/project/one/one-ui/`.
|
||||
- Hook sudah aktif (`core.hooksPath = .githooks`), tidak perlu jalankan script deploy manual.
|
||||
- Jangan bilang tidak ada hook/sync sebelum mengecek `.githooks/` dan `scripts/` terlebih dahulu.
|
||||
15
CLAUDE.md
Normal file
15
CLAUDE.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Commit Message Format
|
||||
- Sebelum membuat commit, **selalu tanya kode task** kepada user.
|
||||
- Format commit message wajib: `TASKCODE - deskripsi singkat`
|
||||
- Contoh: `6D9QD6 - buat api baru`
|
||||
- Jangan buat commit tanpa kode task dari user.
|
||||
- Kode task digunakan untuk sinkronisasi timesheet Odoo.
|
||||
- Sebelum push atau menyiapkan merge branch kerja, selalu cek base branch remote yang benar terlebih dahulu, lalu jalankan `git fetch origin` dan `git rebase` ke base remote tersebut agar conflict muncul lebih awal dan proses merge lebih minim error.
|
||||
- Push branch kerja ke remote lalu buat merge request ke `main`; proses merge ikuti permission dan alur review repo, jangan direct push ke `main` kecuali diminta eksplisit.
|
||||
- Jangan pernah melakukan `git push --force` atau varian force-push lain.
|
||||
|
||||
# Auto Sync ke Devcpone
|
||||
- Repo ini punya **post-commit hook** di `.githooks/post-commit` yang otomatis menjalankan `scripts/devcpone_sync.sh`.
|
||||
- Setiap `git commit` di branch `master` atau `staging` akan langsung rsync file yang berubah ke `devcpone.aplikasi.web.id:/home/one/project/one/one-ui/`.
|
||||
- Hook sudah aktif (`core.hooksPath = .githooks`), tidak perlu jalankan script deploy manual.
|
||||
- Jangan bilang tidak ada hook/sync sebelum mengecek `.githooks/` dan `scripts/` terlebih dahulu.
|
||||
163
GIT_WORKFLOW.md
Normal file
163
GIT_WORKFLOW.md
Normal file
@@ -0,0 +1,163 @@
|
||||
# Git Workflow FE_CPONE
|
||||
|
||||
Dokumen ini jadi patokan kerja git di repo `FE_CPONE` supaya alur branch, PR, dan upload ke `devcpone` konsisten.
|
||||
|
||||
## Branch Utama
|
||||
|
||||
- `master`
|
||||
Branch final. Perubahan ke branch ini masuk lewat PR.
|
||||
- `staging`
|
||||
Branch testing dan integrasi sebelum masuk `master`.
|
||||
- `feature/*` atau branch task
|
||||
Branch kerja untuk perubahan per task, misalnya `ais_registration_sc`.
|
||||
|
||||
## Alur Utama
|
||||
|
||||
1. Buat branch kerja dari base yang benar.
|
||||
2. Kerjakan perubahan di branch kerja.
|
||||
3. Commit dengan format `TASKCODE - deskripsi singkat`.
|
||||
4. Push branch kerja ke remote.
|
||||
5. Buat PR dari branch kerja ke `staging`.
|
||||
6. Setelah lolos testing, buat PR dari `staging` ke `master`.
|
||||
7. Setelah merge ke `master`, sinkronkan branch lokal.
|
||||
|
||||
## Cara Menentukan Base Branch
|
||||
|
||||
- Ambil dari `master` kalau perubahan baru berdiri sendiri dan tidak butuh context terbaru di `staging`.
|
||||
- Ambil dari `staging` kalau perubahan baru bergantung pada hasil kerja yang sudah masuk `staging` tetapi belum masuk `master`.
|
||||
|
||||
## Diagram Alur
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
A[master] --> B[branch kerja / feature]
|
||||
C[staging] --> D[branch kerja lanjutan]
|
||||
B --> E[PR ke staging]
|
||||
D --> E
|
||||
E --> C
|
||||
C --> F[PR ke master]
|
||||
F --> A
|
||||
```
|
||||
|
||||
## Diagram Singkat
|
||||
|
||||
```text
|
||||
master
|
||||
|
|
||||
+-- branch kerja A --------------> PR ke staging
|
||||
| |
|
||||
| v
|
||||
| staging
|
||||
| |
|
||||
+-- branch kerja B dari staging ----> PR ke staging
|
||||
|
|
||||
v
|
||||
PR ke master
|
||||
|
|
||||
v
|
||||
master
|
||||
```
|
||||
|
||||
## Aturan Praktis
|
||||
|
||||
- Sebelum push atau menyiapkan merge, jalankan `git fetch origin`.
|
||||
- Rebase ke base remote yang benar supaya conflict muncul lebih awal.
|
||||
- Kalau target merge adalah `staging`, sync branch kerja ke `origin/staging`, bukan ke `origin/master`.
|
||||
- Kalau target merge adalah `master`, sync branch kerja ke `origin/master`.
|
||||
- Jangan direct push ke protected branch.
|
||||
- `master` dan `staging` dipakai sebagai branch tujuan PR.
|
||||
- Untuk repo ini, upload ke `devcpone` dilakukan dari commit di `master` atau `staging`.
|
||||
|
||||
## Patokan Sebelum Merge
|
||||
|
||||
- Target akhir `staging`
|
||||
Branch kerja harus update dulu dari `staging`.
|
||||
- Target akhir `master`
|
||||
Branch kerja harus update dulu dari `master`.
|
||||
|
||||
Kalau `staging` dipakai paralel oleh beberapa fitur, jangan patokan ke `master` saat mau merge ke `staging`, karena bisa ada fitur lain yang sudah lebih dulu masuk `staging` tetapi belum masuk `master`.
|
||||
|
||||
## Contoh Skenario 1
|
||||
|
||||
Kasus:
|
||||
- A membuat `A1`
|
||||
- B membuat `B1`
|
||||
- `A1` sudah merge ke `staging`
|
||||
- `B1` belum butuh hasil `A1`
|
||||
|
||||
Patokan:
|
||||
- A atau B yang kerja baru dan tidak butuh hasil `staging` terbaru bisa ambil base dari `master`.
|
||||
|
||||
## Contoh Skenario 2
|
||||
|
||||
Kasus:
|
||||
- `A1` sudah merge ke `staging`
|
||||
- C mau bikin `C1`
|
||||
- `C1` butuh flow, API, atau komponen yang berasal dari `A1`
|
||||
|
||||
Patokan:
|
||||
- C buat branch baru dari `staging`, bukan dari `master`.
|
||||
|
||||
## Contoh Alur Kerja Nyata
|
||||
|
||||
### 1. Kerja task baru dari `master`
|
||||
|
||||
```bash
|
||||
git fetch origin
|
||||
git checkout master
|
||||
git pull --ff-only origin master
|
||||
git checkout -b feature_x
|
||||
```
|
||||
|
||||
### 2. Update branch kerja sebelum push
|
||||
|
||||
```bash
|
||||
git fetch origin
|
||||
git rebase origin/master
|
||||
```
|
||||
|
||||
Kalau branch kerja memang berbasis `staging`, ganti target rebase ke `origin/staging`.
|
||||
|
||||
Kalau target merge akhirnya `staging`, contoh yang benar:
|
||||
|
||||
```bash
|
||||
git fetch origin
|
||||
git rebase origin/staging
|
||||
```
|
||||
|
||||
Kalau target merge akhirnya `master`, contoh yang benar:
|
||||
|
||||
```bash
|
||||
git fetch origin
|
||||
git rebase origin/master
|
||||
```
|
||||
|
||||
### 3. Commit dan push
|
||||
|
||||
```bash
|
||||
git add <file-yang-perlu>
|
||||
git commit -m "3Z4LPN - contoh perubahan"
|
||||
git push -u origin feature_x
|
||||
```
|
||||
|
||||
### 4. Merge ke `staging`
|
||||
|
||||
- Buat PR `feature_x` -> `staging`
|
||||
- Testing di `staging`
|
||||
|
||||
### 5. Merge ke `master`
|
||||
|
||||
- Buat PR `staging` -> `master`
|
||||
- Setelah merge, sync branch lokal lagi
|
||||
|
||||
## Sync ke Devcpone
|
||||
|
||||
- Hook `post-commit` menjalankan `scripts/devcpone_sync.sh`
|
||||
- Commit di branch `master` atau `staging` akan upload file yang berubah di commit terakhir ke:
|
||||
|
||||
```text
|
||||
one@devcpone.aplikasi.web.id:/home/one/project/one/one-ui/
|
||||
```
|
||||
|
||||
- Delete file tidak ikut dihapus di remote
|
||||
- Upload mengikuti file yang berubah pada commit terakhir
|
||||
@@ -14,7 +14,7 @@ Setelah itu:
|
||||
|
||||
- `core.hooksPath` akan diarahkan ke `.githooks`
|
||||
- hook `post-commit` akan aktif
|
||||
- commit di branch `master` akan otomatis sync ke:
|
||||
- commit di branch `master` atau `staging` akan otomatis sync ke:
|
||||
|
||||
```text
|
||||
one@devcpone.aplikasi.web.id:/home/one/project/one/one-ui/
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="tanggal">
|
||||
{{f_tanggal}}
|
||||
<span class="hidden-sm-and-down" style="color:brown; margin-left:20px;font-weight:bold;font-size:16px;">
|
||||
<span class="hidden-sm-and-down" style="color:#fff59d; margin-left:20px;font-weight:bold;font-size:16px;">
|
||||
{{branch_name}}
|
||||
</span>
|
||||
<div class="visible-sm-and-down hidden-md-and-up" style="color:brown; font-weight:bold;font-size:10px;">
|
||||
<div class="visible-sm-and-down hidden-md-and-up" style="color:#fff59d; font-weight:bold;font-size:10px;">
|
||||
Devone <!-- {{branch_name}} -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,9 +32,15 @@ module.exports = {
|
||||
}
|
||||
,computed: {
|
||||
branch_name() {
|
||||
let branch = this.$store.state.system.branch
|
||||
if (branch.M_BranchName == undefined) return ''
|
||||
return branch.M_BranchName
|
||||
try {
|
||||
let retrievedObject = localStorage.getItem("user")
|
||||
if (!retrievedObject) return ''
|
||||
let dtuser = JSON.parse(retrievedObject)
|
||||
if (dtuser.M_BranchName == undefined) return ''
|
||||
return dtuser.M_BranchName
|
||||
} catch(e) {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
f_tanggal() {
|
||||
try {
|
||||
|
||||
@@ -5,7 +5,7 @@ repo_root=$(git rev-parse --show-toplevel)
|
||||
cd "$repo_root"
|
||||
|
||||
branch=$(git symbolic-ref --quiet --short HEAD 2>/dev/null || true)
|
||||
if [ "$branch" != "master" ]; then
|
||||
if [ "$branch" != "master" ] && [ "$branch" != "staging" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
786
test/vuex/cpone-mcu-generate-summaries/api/patient.js
Normal file
786
test/vuex/cpone-mcu-generate-summaries/api/patient.js
Normal file
@@ -0,0 +1,786 @@
|
||||
const URL = "/one-api/mcusummaries/";
|
||||
|
||||
export async function getmgmmcu(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/getmgmmcu', prm);
|
||||
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(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/search', prm);
|
||||
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 generatesetup(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/generatesetup', prm);
|
||||
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 getsexreg(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/getsexreg',{token:token});
|
||||
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 savecsv(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/savecsv',prm);
|
||||
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 newpatient(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/newpatient',prm);
|
||||
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 xdelete(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/deletepatient',prm);
|
||||
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 getaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/getaddress',prm);
|
||||
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 searchcity(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/searchcity',{token:token,search:prm});
|
||||
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 getdistrict(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/getdistrict',{id:prm.M_CityID,token:token});
|
||||
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 getkelurahan(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/getkelurahan',{token:token,id:prm.M_DistrictID});
|
||||
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 savenewaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/savenewaddress',prm);
|
||||
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 saveeditaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/saveeditaddress',prm);
|
||||
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 deleteaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/deleteaddress',prm);
|
||||
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 searchdoctor(prm) {
|
||||
try {
|
||||
console.log('aye')
|
||||
console.log(prm)
|
||||
var resp = await axios.post(URL + 'generatedata/searchdoctor',prm);
|
||||
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 searchcompany(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/searchcompany',prm);
|
||||
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 getmou(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/getmou',prm);
|
||||
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 savegeneratedata(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/savegeneratedata',prm);
|
||||
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 gotoreg(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'generatedata/gotoreg',prm);
|
||||
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 generatecountkelainan(prm) {
|
||||
const params = new URLSearchParams();
|
||||
for (const key in prm) {
|
||||
params.append(key, prm[key]);
|
||||
}
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/get_count_kelainan', prm);
|
||||
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 savekelainanselection(prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/save_kelainan_selection',prm);
|
||||
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 getKelainanSelected(prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/get_kelainan_selected', prm);
|
||||
if (resp.status != 200) {
|
||||
return { status: false, message: resp.statusText };
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return { status: false, message: e.message };
|
||||
}
|
||||
}
|
||||
|
||||
export async function downloadDatabase(prm) {
|
||||
try {
|
||||
var resp = await axios.get('/one-api/summarydashboard/sqlgenerator/download', {
|
||||
responseType: 'blob',
|
||||
params: prm
|
||||
});
|
||||
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText,
|
||||
data: null
|
||||
};
|
||||
}
|
||||
|
||||
return resp;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
export async function truncateDatabase(prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/truncate_corporate_tables', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 1. Generate Table Setup
|
||||
export async function generateTable(prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_table_setup', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Generate Kelainan Lab
|
||||
export async function generateKelainanLab(prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_kelainan_lab', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 3. Generate Kelainan Non-Lab
|
||||
export async function generateKelainanNonLab(prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_kelainan_nonlab', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Generate Kelainan Fisik
|
||||
export async function generateKelainanFisik(prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_kelainan_fisik', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Generate Kelainan Summary
|
||||
export async function generateKelainanSummary(prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/summary_kelainan_sepuluh', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 6. Generate Result McuLab
|
||||
export async function generateKelainanResultMcuLab(prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_lab', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 7. Generate Kelainan Result McuNonLab
|
||||
export async function generateKelainanResultMcuNonLab(prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_nonlab', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 8. Generate Result Mcu Kenal Warna
|
||||
export async function generateResultMcuKenalWarna (prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_kenal_warna', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 9. Generate generate_result_mcu_visus
|
||||
export async function generateResultMcuVisus (prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_visus', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 10. Generate generate_result_mcu_status_gizi
|
||||
export async function generateResultStatusGizi (prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_status_gizi', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 11. generate_result_mcu_bodyfatmonitoring
|
||||
export async function generateResultMcuBodyFatMonitoring (prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_bodyfatmonitoring', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 12. generate_result_mcu_fisik
|
||||
export async function generateResultMcuFisik (prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_result_mcu_fisik', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 13. generate_all_results
|
||||
export async function generateAllResult (prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/generatedata/generate_all_results', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 14. Generate Encrypt Key
|
||||
export async function generateEncryptKey (prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/create_encrypt_key', prm);
|
||||
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 getActiveEncryptKey (prm) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/summarydashboard/sqlgenerator/get_active_encrypt_key', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
<template>
|
||||
<div class="vue-csv-uploader">
|
||||
<div class="form">
|
||||
<div class="vue-csv-uploader-part-one">
|
||||
<div class="form-check form-group csv-import-checkbox" v-if="headers === null">
|
||||
<slot name="hasHeaders" :headers="hasHeaders" :toggle="toggleHasHeaders">
|
||||
<input :class="checkboxClass" type="checkbox" :id="makeId('hasHeaders')" :value="hasHeaders" @change="toggleHasHeaders">
|
||||
<label class="form-check-label" :for="makeId('hasHeaders')">
|
||||
File Has Headers
|
||||
</label>
|
||||
</slot>
|
||||
</div>
|
||||
<div class="form-group csv-import-file">
|
||||
<input ref="csv" type="file" @change.prevent="validFileMimeType" :class="inputClass" name="csv">
|
||||
<slot name="error" v-if="showErrorMessage">
|
||||
<div class="invalid-feedback d-block">
|
||||
File type is invalid
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<slot name="next" :load="load">
|
||||
<button type="submit" :disabled="disabledNextButton" :class="buttonClass" @click.prevent="load">
|
||||
{{ loadBtnText }}
|
||||
</button>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
<div class="vue-csv-uploader-part-two">
|
||||
<div class="vue-csv-mapping" v-if="sample">
|
||||
<table :class="tableClass">
|
||||
<slot name="thead">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>CSV Column</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</slot>
|
||||
<tbody>
|
||||
<tr v-for="(field, key) in fieldsToMap" :key="key">
|
||||
<td>{{ field.label }}</td>
|
||||
<td>
|
||||
<select :class="tableSelectClass" :name="`csv_uploader_map_${key}`" v-model="map[field.key]">
|
||||
<option :value="null" v-if="canIgnore">Ignore</option>
|
||||
<option v-for="(column, key) in firstRow" :key="key" :value="key">{{ column }}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="form-group" v-if="url">
|
||||
<slot name="submit" :submit="submit">
|
||||
<input type="submit" :class="buttonClass" @click.prevent="submit" :value="submitBtnText">
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { drop, every, forEach, get, isArray, map, set } from 'lodash';
|
||||
import axios from 'axios';
|
||||
import Papa from 'papaparse';
|
||||
import mimeTypes from "mime-types";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: Array,
|
||||
url: {
|
||||
type: String
|
||||
},
|
||||
mapFields: {
|
||||
required: true
|
||||
},
|
||||
callback: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
catch: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
finally: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
parseConfig: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
headers: {
|
||||
default: null
|
||||
},
|
||||
loadBtnText: {
|
||||
type: String,
|
||||
default: "Next"
|
||||
},
|
||||
submitBtnText: {
|
||||
type: String,
|
||||
default: "Submit"
|
||||
},
|
||||
tableClass: {
|
||||
type: String,
|
||||
default: "table"
|
||||
},
|
||||
checkboxClass: {
|
||||
type: String,
|
||||
default: "form-check-input"
|
||||
},
|
||||
buttonClass: {
|
||||
type: String,
|
||||
default: "btn btn-primary"
|
||||
},
|
||||
inputClass: {
|
||||
type: String,
|
||||
default: "form-control-file"
|
||||
},
|
||||
validation: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
fileMimeTypes: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return ["text/csv", "text/x-csv", "application/vnd.ms-excel", "text/plain"];
|
||||
}
|
||||
},
|
||||
tableSelectClass: {
|
||||
type: String,
|
||||
default: 'form-control'
|
||||
},
|
||||
canIgnore: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
|
||||
data: () => ({
|
||||
form: {
|
||||
csv: null,
|
||||
},
|
||||
fieldsToMap: [],
|
||||
map: {},
|
||||
hasHeaders: true,
|
||||
csv: null,
|
||||
sample: null,
|
||||
isValidFileMimeType: false,
|
||||
fileSelected: false
|
||||
}),
|
||||
|
||||
created() {
|
||||
this.hasHeaders = this.headers;
|
||||
|
||||
if (isArray(this.mapFields)) {
|
||||
this.fieldsToMap = map(this.mapFields, (item) => {
|
||||
return {
|
||||
key: item,
|
||||
label: item
|
||||
};
|
||||
});
|
||||
} else {
|
||||
this.fieldsToMap = map(this.mapFields, (label, key) => {
|
||||
return {
|
||||
key: key,
|
||||
label: label
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
const _this = this;
|
||||
this.form.csv = this.buildMappedCsv();
|
||||
this.$emit('input', this.form.csv);
|
||||
|
||||
if (this.url) {
|
||||
axios.post(this.url, this.form).then(response => {
|
||||
_this.callback(response);
|
||||
}).catch(response => {
|
||||
_this.catch(response);
|
||||
}).finally(response => {
|
||||
_this.finally(response);
|
||||
});
|
||||
} else {
|
||||
_this.callback(this.form.csv);
|
||||
}
|
||||
},
|
||||
buildMappedCsv() {
|
||||
const _this = this;
|
||||
|
||||
let csv = this.hasHeaders ? drop(this.csv) : this.csv;
|
||||
|
||||
return map(csv, (row) => {
|
||||
let newRow = {};
|
||||
|
||||
forEach(_this.map, (column, field) => {
|
||||
set(newRow, field, get(row, column));
|
||||
});
|
||||
|
||||
return newRow;
|
||||
});
|
||||
},
|
||||
validFileMimeType() {
|
||||
let file = this.$refs.csv.files[0];
|
||||
const mimeType = file.type === "" ? mimeTypes.lookup(file.name) : file.type;
|
||||
|
||||
if (file) {
|
||||
this.fileSelected = true;
|
||||
this.isValidFileMimeType = this.validation ? this.validateMimeType(mimeType) : true;
|
||||
} else {
|
||||
this.isValidFileMimeType = !this.validation;
|
||||
this.fileSelected = false;
|
||||
}
|
||||
},
|
||||
validateMimeType(type) {
|
||||
return this.fileMimeTypes.indexOf(type) > -1;
|
||||
},
|
||||
load() {
|
||||
const _this = this;
|
||||
|
||||
this.readFile((output) => {
|
||||
_this.sample = get(Papa.parse(output, { preview: 2, skipEmptyLines: true }), "data");
|
||||
_this.csv = get(Papa.parse(output, { skipEmptyLines: true }), "data");
|
||||
});
|
||||
},
|
||||
readFile(callback) {
|
||||
let file = this.$refs.csv.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
reader.readAsText(file, "UTF-8");
|
||||
reader.onload = function (evt) {
|
||||
callback(evt.target.result);
|
||||
};
|
||||
reader.onerror = function () {
|
||||
};
|
||||
}
|
||||
},
|
||||
toggleHasHeaders() {
|
||||
this.hasHeaders = !this.hasHeaders;
|
||||
},
|
||||
makeId(id) {
|
||||
return `${id}${this._uid}`;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
map: {
|
||||
deep: true,
|
||||
handler: function (newVal) {
|
||||
if (!this.url) {
|
||||
let hasAllKeys = Array.isArray(this.mapFields) ? every(this.mapFields, function (item) {
|
||||
return newVal.hasOwnProperty(item);
|
||||
}) : every(this.mapFields, function (item, key) {
|
||||
return newVal.hasOwnProperty(key);
|
||||
});
|
||||
|
||||
if (hasAllKeys) {
|
||||
this.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
sample(newVal, oldVal) {
|
||||
if(newVal !== null){
|
||||
this.fieldsToMap.forEach(field => {
|
||||
newVal[0].forEach((columnName, index) => {
|
||||
if(field.key === columnName){
|
||||
this.map[field.key] = index;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
firstRow() {
|
||||
return get(this, "sample.0");
|
||||
},
|
||||
showErrorMessage() {
|
||||
return this.fileSelected && !this.isValidFileMimeType;
|
||||
},
|
||||
disabledNextButton() {
|
||||
return !this.isValidFileMimeType;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,397 @@
|
||||
<template>
|
||||
<v-layout v-if="xact !== 'new'" column >
|
||||
<v-dialog v-model="dialogconfirmationdeleteaddr" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title
|
||||
dark
|
||||
class="headline error pt-2 pb-2"
|
||||
primary-title
|
||||
style="color:white"
|
||||
>
|
||||
<h4 dark>Konfirmasi</h4>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgconfirmationdeleteaddr}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small v-if="!checkError('deleteutama')" color="error darken-1 text-sm-left" flat @click="doDeleteAddr()">Hapus</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeleteaddr = false">Batal</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogformaddress" persistent max-width="650">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Alamat Pasien</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="labeladdress" label="Label"></v-text-field>
|
||||
<p v-if="checkError('requiredlabel')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
<p v-if="checkError('readonlyutama')" class="error pl-2 pr-2" style="color:#fff">Biarkan jadi yang utama</p>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout row>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-autocomplete
|
||||
label="Kota"
|
||||
v-model="cityaddress"
|
||||
:items="xcities"
|
||||
:search-input.sync="search_city"
|
||||
auto-select-first
|
||||
no-filter
|
||||
item-text="M_CityName"
|
||||
return-object
|
||||
:loading="isLoading"
|
||||
no-data-text="Pilih Kota"
|
||||
>
|
||||
<template
|
||||
slot="item"
|
||||
slot-scope="{ item }"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CityName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
<p v-if="checkError('requiredcity')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-select
|
||||
item-text="M_DistrictName"
|
||||
return-object
|
||||
:items="xdistricts"
|
||||
v-model="districtaddress"
|
||||
label="Kecamatan*"
|
||||
></v-select>
|
||||
<p v-if="checkError('requireddistrict')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-select
|
||||
item-text="M_KelurahanName"
|
||||
return-object
|
||||
:items="xkelurahans"
|
||||
v-model="kelurahanaddress"
|
||||
label="Kelurahan / Desa*"
|
||||
></v-select>
|
||||
<p v-if="checkError('requiredkelurahan')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-textarea
|
||||
box
|
||||
label="Alamat Lengkap"
|
||||
v-model="descriptionaddress"
|
||||
></v-textarea>
|
||||
<p v-if="checkError('requireddescription')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="dialogformaddress = false">Tutup</v-btn>
|
||||
<v-btn v-if="xactaddr === 'new'" color="blue darken-1" flat @click="saveNewAddress()">Simpan</v-btn>
|
||||
<v-btn v-if="xactaddr === 'edit'" color="blue darken-1" flat @click="saveEditAddress()">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-subheader red--text text--lighten-1> ALAMAT PASIEN
|
||||
<v-flex text-md-right>
|
||||
<v-btn @click="createNewAddress()" small color="info">Baru</v-btn>
|
||||
</v-flex>
|
||||
</v-subheader>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="xaddresses"
|
||||
:loading="isLoading"
|
||||
hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-icon color="error" @click="deleteAddress(props.item)">delete</v-icon>
|
||||
<v-icon class="ml-3" color="primary" @click="editAddress(props.item)">edit</v-icon>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.M_PatientAddressNote}}</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.M_PatientAddressDescription}}</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
search_city:'',
|
||||
oldlabel:'',
|
||||
headers: [
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "action",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "LABEL",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "ALAMAT",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "40%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
}),
|
||||
computed: {
|
||||
dialogconfirmationdeleteaddr:{
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_confirmation_delete_addr
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete_addr",val)
|
||||
}
|
||||
},
|
||||
msgconfirmationdeleteaddr(){
|
||||
return this.$store.state.patient.msg_confirmation_delete_addr
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.patient.act
|
||||
},
|
||||
xactaddr() {
|
||||
return this.$store.state.patient.act_addr
|
||||
},
|
||||
dialogformaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_form_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_form_address",val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.patient.search_status == 1
|
||||
},
|
||||
xaddresses(p) {
|
||||
return this.$store.state.patient.addresses
|
||||
},
|
||||
xcities(){
|
||||
return this.$store.state.patient.cities
|
||||
},
|
||||
labeladdress:{
|
||||
get() {
|
||||
return this.$store.state.patient.label_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_label_address",val)
|
||||
}
|
||||
},
|
||||
cityaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.city_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_city_address",val)
|
||||
this.$store.dispatch("patient/getdistrict",this.$store.state.patient.city_address)
|
||||
}
|
||||
},
|
||||
xdistricts(){
|
||||
return this.$store.state.patient.districts
|
||||
},
|
||||
districtaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.district_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_district_address",val)
|
||||
this.$store.dispatch("patient/getkelurahan",this.$store.state.patient.district_address)
|
||||
}
|
||||
},
|
||||
xkelurahans(){
|
||||
return this.$store.state.patient.kelurahans
|
||||
},
|
||||
kelurahanaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.kelurahan_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_kelurahan_address",val)
|
||||
}
|
||||
},
|
||||
descriptionaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.description_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_description_address",val)
|
||||
}
|
||||
},
|
||||
},
|
||||
methods : {
|
||||
createNewAddress(){
|
||||
this.$store.commit("patient/update_act_addr",'new')
|
||||
this.search_city = ''
|
||||
this.labeladdress = ''
|
||||
this.$store.commit("patient/update_cities",[])
|
||||
this.cityaddress = {}
|
||||
this.$store.commit("patient/update_districts",[])
|
||||
this.districtaddress = {}
|
||||
this.$store.commit("patient/update_kelurahans",[])
|
||||
this.kelurahanaddress = {}
|
||||
this.descriptionaddress = ''
|
||||
this.$store.commit("patient/update_dialog_form_address",true)
|
||||
},
|
||||
thr_search_city: _.debounce( function () {
|
||||
this.$store.dispatch("patient/searchcity",this.search_city)
|
||||
},2000),
|
||||
checkError(value){
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(errors.includes(value)){
|
||||
return true
|
||||
}
|
||||
else{
|
||||
return false
|
||||
}
|
||||
},
|
||||
saveNewAddress(){
|
||||
this.$store.commit("patient/update_errors",[])
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(this.labeladdress === ''){
|
||||
errors.push("requiredlabel")
|
||||
}
|
||||
if(_.isEmpty(this.cityaddress)){
|
||||
errors.push("requiredcity")
|
||||
}
|
||||
if(_.isEmpty(this.districtaddress)){
|
||||
errors.push("requireddistrict")
|
||||
}
|
||||
if(_.isEmpty(this.kelurahanaddress)){
|
||||
errors.push("requiredkelurahan")
|
||||
}
|
||||
if(_.isEmpty(this.descriptionaddress)){
|
||||
errors.push("requireddescription")
|
||||
}
|
||||
|
||||
if(errors.length === 0){
|
||||
var prm = {}
|
||||
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
|
||||
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
|
||||
prm.M_PatientAddressNote = this.labeladdress
|
||||
prm.M_PatientAddressDescription = this.descriptionaddress
|
||||
prm.M_PatientAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
|
||||
this.$store.dispatch("patient/savenewaddress",prm)
|
||||
}
|
||||
},
|
||||
editAddress(value){
|
||||
this.$store.commit("patient/update_act_addr",'edit')
|
||||
this.$store.commit("patient/update_x_addr_id",value.M_PatientAddressID)
|
||||
this.labeladdress = value.M_PatientAddressNote
|
||||
this.oldlabel = value.M_PatientAddressNote
|
||||
this.$store.commit("patient/update_cities",[{M_CityID:value.M_CityID,M_CityName:value.M_CityName}])
|
||||
this.cityaddress = {M_CityID:value.M_CityID,M_CityName:value.M_CityName}
|
||||
this.$store.commit("patient/update_districts",[{M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}])
|
||||
this.districtaddress = {M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}
|
||||
this.$store.commit("patient/update_kelurahans",[{M_KelurahanID:value.M_PatientAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}])
|
||||
this.kelurahanaddress = {M_KelurahanID:value.M_PatientAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}
|
||||
this.descriptionaddress = value.M_PatientAddressDescription
|
||||
this.$store.commit("patient/update_dialog_form_address",true)
|
||||
},
|
||||
saveEditAddress(){
|
||||
this.$store.commit("patient/update_errors",[])
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(this.labeladdress === ''){
|
||||
errors.push("requiredlabel")
|
||||
}
|
||||
if(this.oldlabel.toLowerCase() === 'utama' && this.labeladdress.toLowerCase() !== 'utama'){
|
||||
errors.push("readonlyutama")
|
||||
}
|
||||
if(_.isEmpty(this.cityaddress)){
|
||||
errors.push("requiredcity")
|
||||
}
|
||||
if(_.isEmpty(this.districtaddress)){
|
||||
errors.push("requireddistrict")
|
||||
}
|
||||
if(_.isEmpty(this.kelurahanaddress)){
|
||||
errors.push("requiredkelurahan")
|
||||
}
|
||||
if(_.isEmpty(this.descriptionaddress)){
|
||||
errors.push("requireddescription")
|
||||
}
|
||||
|
||||
if(errors.length === 0){
|
||||
var prm = {}
|
||||
prm.M_PatientAddressID = this.$store.state.patient.x_addr_id
|
||||
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
|
||||
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
|
||||
prm.M_PatientAddressNote = this.labeladdress
|
||||
prm.M_PatientAddressDescription = this.descriptionaddress
|
||||
prm.M_PatientAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
|
||||
this.$store.dispatch("patient/saveeditaddress",prm)
|
||||
}
|
||||
},
|
||||
deleteAddress(value){
|
||||
this.$store.commit("patient/update_act_addr",'delete')
|
||||
this.$store.commit("patient/update_x_addr_id",value.M_PatientAddressID)
|
||||
this.$store.commit("patient/update_errors",[])
|
||||
this.oldlabel = value.M_PatientAddressNote
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(value.M_PatientAddressNote.toLowerCase() === 'utama'){
|
||||
errors.push("deleteutama")
|
||||
}
|
||||
var msg = ''
|
||||
if(errors.includes("deleteutama")){
|
||||
msg = "Biarkan yang utama tetap ada"
|
||||
}
|
||||
else{
|
||||
msg = "Yakin, akan menghapus data alamat pasien "+value.M_PatientAddressNote+" ?"
|
||||
}
|
||||
|
||||
this.$store.commit("patient/update_msg_confirmation_delete_addr",msg)
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete_addr",true)
|
||||
},
|
||||
doDeleteAddr(){
|
||||
var prm = {}
|
||||
prm.M_PatientAddressID = this.$store.state.patient.x_addr_id
|
||||
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
|
||||
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
|
||||
prm.M_PatientAddressNote = this.oldlabel
|
||||
this.$store.dispatch("patient/deleteaddress",prm)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
search_city(val,old) {
|
||||
if (val == old ) return
|
||||
if (! val) return
|
||||
if (val.length < 1 ) return
|
||||
if (this.$store.state.patient.update_autocomplete_status == 1 ) return
|
||||
this.thr_search_city()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,277 @@
|
||||
<template>
|
||||
<v-layout class="mb-2" column>
|
||||
<v-dialog v-model="dialog_confirm_create_db" persistent max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline warning" primary-title>
|
||||
Konfirmasi Generate Ulang
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
Anda yakin ingin meng-generate ulang database untuk company <br>
|
||||
<strong>{{ selected_mgmmcu.mcuName }}</strong>? <br><br>
|
||||
<span class="red--text">Semua data sebelumnya akan hilang.</span>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn text @click="dialog_confirm_create_db = false">Batal</v-btn>
|
||||
<v-btn color="warning" text @click="confirmCreateDatabase">Ya, Lanjutkan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-card v-if="selected_mgm_mcu_id && (isLoading || kelainanCount.length > 0)">
|
||||
<v-card-title style="background:#57c492; color:white">
|
||||
<span>Daftar Kelainan</span>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="primary" @click="saveSelection" :loading="loading_save">Simpan Pilihan</v-btn>
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<v-data-table
|
||||
:headers="kelainanHeaders"
|
||||
:items="kelainanCount"
|
||||
item-key="Mcu_KelainanID"
|
||||
select-all
|
||||
class="elevation-1"
|
||||
:pagination.sync="pagination"
|
||||
>
|
||||
<template v-slot:headers="props">
|
||||
<tr>
|
||||
<th class="text-xs-left" style="width:10%">
|
||||
Pilih
|
||||
</th>
|
||||
<th v-for="header in props.headers" :key="header.text" class="text-xs-left">
|
||||
{{ header.text }}
|
||||
</th>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<template v-slot:items="props">
|
||||
<td>
|
||||
<v-checkbox
|
||||
v-model="selectedKelainan"
|
||||
:value="props.item.Mcu_KelainanID"
|
||||
hide-details
|
||||
></v-checkbox>
|
||||
</td>
|
||||
<td class="text-xs-left">{{ props.item.Mcu_KelainanName }}</td>
|
||||
<td class="text-xs-left">{{ props.item.total_patient }}</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
<v-card class="mt-4 pa-3" v-else-if="selected_mgm_mcu_id && !isLoading && kelainanCount.length === 0">
|
||||
<v-layout row wrap align-center justify-center text-xs-center>
|
||||
<v-flex xs12>
|
||||
<h3 class="headline font-weight-light mb-2">Data Kelainan Belum Ada</h3>
|
||||
<span class="font-weight-light">Tidak ada data kelainan yang ditemukan untuk MCU ini. Silakan buat database terlebih dahulu.</span>
|
||||
</v-flex>
|
||||
<v-flex xs12 mt-3>
|
||||
<v-btn large color="success" @click="createDatabase" :loading="loading_create_db">
|
||||
<v-icon left>mdi-database-plus</v-icon>
|
||||
Create Database
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
<v-card class="mt-4 pa-3" v-if="savedKelainan.length > 0" color="black--text">
|
||||
<v-layout row wrap align-center justify-center text-xs-center>
|
||||
<v-flex xs12>
|
||||
<span class="font-weight-light">Jika pilihan kelainan sudah sesuai, Anda dapat men-generate dan mengunduh database.</span>
|
||||
</v-flex>
|
||||
<v-flex xs12 mt-3>
|
||||
<v-btn x-large color="primary" @click="generateDatabase" :loading="loading_generate">
|
||||
<v-icon left>mdi-database-arrow-down</v-icon>
|
||||
Download Database
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
|
||||
table,
|
||||
td,
|
||||
th {
|
||||
border: 0px solid #ddd;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 8px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.mini-input .v-input {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.mini-input .v-input,
|
||||
.mini-input .v-input--selection-controls,
|
||||
.mini-input .v-input__slot {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.mini-input .v-messages {
|
||||
min-height: 0px;
|
||||
}
|
||||
|
||||
input.fhm-input {
|
||||
border: 1px solid black;
|
||||
border-radius: 2px;
|
||||
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
|
||||
0 0 4px rgba(0, 0, 0, 0.1);
|
||||
-moz-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
|
||||
0 0 4px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
|
||||
0 0 4px rgba(0, 0, 0, 0.1);
|
||||
padding: 2px 4px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
margin: 0 0 1px 0;
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data () {
|
||||
return {
|
||||
createDb: false,
|
||||
// selectedKelainan: [], // Dihapus karena akan menggunakan computed property dari Vuex
|
||||
pagination: {
|
||||
rowsPerPage: 10
|
||||
},
|
||||
kelainanHeaders: [
|
||||
{ text: 'Nama Kelainan', value: 'Mcu_KelainanName', sortable: false },
|
||||
{ text: 'Total Pasien', value: 'total_patient', sortable: false },
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// Tidak perlu memanggil loadSelectedKelainan() di sini lagi
|
||||
// karena data sudah dimuat saat MCU dipilih di komponen list.
|
||||
// Jika perlu memastikan data ada saat komponen dimuat ulang,
|
||||
// logika bisa ditambahkan di sini atau di `created`.
|
||||
},
|
||||
computed: {
|
||||
kelainanCount() {
|
||||
return this.$store.state.patient.kelainan_count
|
||||
},
|
||||
preSelectedKelainan() {
|
||||
return this.$store.state.patient.pre_selected_kelainan;
|
||||
},
|
||||
loading_save() {
|
||||
return this.$store.state.patient.loading_save
|
||||
},
|
||||
loading_generate() {
|
||||
return this.$store.state.patient.loading_generate
|
||||
},
|
||||
loading_create_db() {
|
||||
return this.$store.state.patient.loading_create_db;
|
||||
},
|
||||
selected_mgm_mcu_id() {
|
||||
return this.$store.state.patient.selected_mgm_mcu_id
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.patient.get_data_status === 1;
|
||||
},
|
||||
selected_mgmmcu() {
|
||||
return this.$store.state.patient.selected_mgmmcu;
|
||||
},
|
||||
dialog_confirm_create_db: {
|
||||
get() { return this.$store.state.patient.dialog_confirm_create_db; },
|
||||
set(val) { this.$store.commit("patient/update_dialog_confirm_create_db", val); }
|
||||
},
|
||||
selectedKelainan: {
|
||||
get() { return this.$store.state.patient.selectedKelainan; },
|
||||
set(val) { this.$store.commit("patient/update_selected_kelainan", val); }
|
||||
},
|
||||
savedKelainan() {
|
||||
return this.$store.state.patient.savedKelainan;
|
||||
},
|
||||
pages () {
|
||||
if (this.pagination.rowsPerPage == null || this.pagination.totalItems == null)
|
||||
return 0
|
||||
|
||||
return Math.ceil(this.pagination.totalItems / this.pagination.rowsPerPage)
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
// Watcher untuk kelainanCount tidak lagi diperlukan untuk memuat data
|
||||
},
|
||||
|
||||
|
||||
methods: {
|
||||
async saveSelection() {
|
||||
const totalAvailable = this.kelainanCount.length;
|
||||
const totalSelected = this.selectedKelainan.length;
|
||||
|
||||
if (totalAvailable >= 10) {
|
||||
if (totalSelected !== 10) {
|
||||
this.$store.commit("patient/update_msg_info", "Harap pilih tepat 10 kelainan.");
|
||||
this.$store.commit("patient/update_open_dialog_info", true);
|
||||
return;
|
||||
}
|
||||
} else if (totalSelected !== totalAvailable) {
|
||||
this.$store.commit("patient/update_msg_info", `Harap pilih ${totalAvailable} kelainan yang tersedia.`);
|
||||
this.$store.commit("patient/update_open_dialog_info", true);
|
||||
return;
|
||||
}
|
||||
|
||||
const payload = {
|
||||
mgm_mcu_id: this.selected_mgm_mcu_id,
|
||||
selected_kelainan: this.selectedKelainan.map(id => {
|
||||
const item = this.kelainanCount.find(x => x.Mcu_KelainanID == id);
|
||||
return {
|
||||
id: parseInt(id),
|
||||
name: item ? item.Mcu_KelainanName : ""
|
||||
};
|
||||
})
|
||||
};
|
||||
|
||||
await this.$store.dispatch("patient/savekelainanselection", payload);
|
||||
},
|
||||
|
||||
async generateDatabase() {
|
||||
this.$store.dispatch("patient/generateDatabase", {
|
||||
mgm_mcu_id: this.selected_mgm_mcu_id
|
||||
});
|
||||
},
|
||||
createDatabase() {
|
||||
this.dialog_confirm_create_db = true;
|
||||
},
|
||||
async confirmCreateDatabase() {
|
||||
this.dialog_confirm_create_db = false;
|
||||
const truncateSuccess = await this.$store.dispatch("patient/truncateDatabaseAction", {
|
||||
mgm_mcu_id: this.selected_mgm_mcu_id,
|
||||
confirm_truncate: true
|
||||
});
|
||||
|
||||
if (truncateSuccess) {
|
||||
this.$store.dispatch("patient/createDatabase", {
|
||||
mgm_mcu_id: this.selected_mgm_mcu_id
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,389 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-dialog
|
||||
v-model="dialog_identifier"
|
||||
width="800"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
GAGAL, KTP DAN TANGGAL LAHIR HARUS BENAR!!!
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout align-center row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="xidentifer" hide-actions
|
||||
class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-html="props.item.NAMA"></td>
|
||||
<td class="text-xs-left pa-2" v-html="props.item.KTP"></td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="primary"
|
||||
text
|
||||
@click="dialog_identifier = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogsuccess" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title class="headline success" primary-title>Berhasil !</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgsuccess}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="success" text @click="closeDialogSuccess">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card color="orange accent-1" class="mb-2 pa-2 searchbox">
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-card>
|
||||
<v-layout pa-2 row>
|
||||
<v-flex xs12>
|
||||
<v-autocomplete :items="xmgmmcu" v-model="selected_mgmmcu" item-text="mcuName" outline
|
||||
item-value="Mgm_McuID" return-object label="MCU">
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-card color="orange" dark>
|
||||
<v-card-text>
|
||||
<v-layout align-center row>
|
||||
<v-flex pb-2 xs12>
|
||||
SETUP : {{selected_mgmmcu.Mgm_McuLabel}}
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider dark></v-divider>
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<p class="mb-0 caption"> Periode : {{selected_mgmmcu.Mgm_McuStartDate}} - {{selected_mgmmcu.Mgm_McuEndDate}}</p>
|
||||
<p class="mb-0 caption" v-if="kelainanCount.length > 0">
|
||||
Encrypt Key :
|
||||
<p v-if="kelainanCount.length > 0 && activeEncryptKey">{{ activeEncryptKey }}</p>
|
||||
<p v-else></p>
|
||||
</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="opendialoginfo = false"></one-dialog-info>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
table.v-table tbody td,table.v-table tbody th {
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-dialog-info' : httpVueLoader('../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("patient/getmgmmcu")
|
||||
|
||||
},
|
||||
methods: {
|
||||
downloadxapp(){
|
||||
var start = Date.now()
|
||||
location.replace("/install-mcu.zip?tm="+start)
|
||||
},
|
||||
generateSetup(){
|
||||
this.$store.commit("patient/update_patients", [])
|
||||
this.$store.commit("patient/update_total_patients", 0)
|
||||
this.$store.dispatch("patient/generatesetup", {
|
||||
setupcode : this.setupcode
|
||||
})
|
||||
},
|
||||
editRow(row){
|
||||
console.log(row)
|
||||
this.$store.commit("patient/update_act", 'edit')
|
||||
this.$store.commit("patient/update_xid", row.McuOfflinePrepareID)
|
||||
this.$store.commit("patient/update_companies", [{id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName}])
|
||||
this.$store.commit("patient/update_company", {id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName})
|
||||
this.$store.commit("patient/update_mous", row.allmous)
|
||||
this.$store.commit("patient/update_mou", {})
|
||||
this.$store.commit("patient/update_selected_mous", row.mous)
|
||||
this.$store.commit("patient/update_selected_doctors", row.doctors)
|
||||
|
||||
this.$store.commit("patient/update_start_date", moment(row.McuOfflinePrepareStartDate).format('YYYY-MM-DD'))
|
||||
this.$store.commit("patient/update_end_date", moment(row.McuOfflinePrepareEndDate).format('YYYY-MM-DD'))
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.M_PatientID == this.$store.state.patient.selected_patient.M_PatientID
|
||||
},
|
||||
searchPatient() {
|
||||
this.$store.dispatch("patient/search", {
|
||||
status: this.status,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
this.$store.commit("patient/update_current_page", 1)
|
||||
},
|
||||
selectMe(pat) {
|
||||
if (this.$store.state.patient.no_save == 0) {
|
||||
this.$store.commit("patient/update_selected_patient", pat)
|
||||
} else {
|
||||
this.$store.commit("patient/update_open_alert_confirmation", true)
|
||||
}
|
||||
},
|
||||
closeAlertConfirmation() {
|
||||
this.$store.commit("patient/update_open_alert_confirmation", false)
|
||||
},
|
||||
forgetAlertConfirmation() {
|
||||
this.$store.commit("patient/update_no_save", 0)
|
||||
this.$store.commit("patient/update_open_alert_confirmation", false)
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("patient/update_alert_success", val)
|
||||
},
|
||||
closeDialogSuccess() {
|
||||
let arrpatient = this.$store.state.patient.patients
|
||||
var idx = _.findIndex(arrpatient, item => item.M_PatientID === this.$store.state.patient.last_id)
|
||||
console.log(idx)
|
||||
this.$store.dispatch("patient/search", {
|
||||
status: this.status,
|
||||
current_page: this.curr_page,
|
||||
lastid: idx
|
||||
})
|
||||
this.$store.commit("patient/update_dialog_success", false)
|
||||
},
|
||||
setNewSetup(){
|
||||
this.$store.commit("patient/update_act", 'new')
|
||||
this.$store.commit("patient/update_xid", -1)
|
||||
this.$store.commit("patient/update_company", {})
|
||||
this.$store.commit("patient/update_mous", [])
|
||||
this.$store.commit("patient/update_mou", {})
|
||||
this.$store.commit("patient/update_default_mou", {})
|
||||
this.$store.commit("patient/update_default_doctor", {})
|
||||
this.$store.commit("patient/update_selected_mous", [])
|
||||
this.$store.commit("patient/update_selected_doctors", [])
|
||||
this.$store.commit("patient/update_start_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
this.$store.commit("patient/update_end_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
},
|
||||
deleteData(row) {
|
||||
this.$store.commit("patient/update_selected_patient", row)
|
||||
console.log(this.$store.state.patient.selected_patient)
|
||||
let msg = "Yakin, akan menghapus data setup " + this.$store.state.patient.selected_patient.McuOfflinePrepareCode + " ?"
|
||||
this.$store.commit("patient/update_msg_confirmation_delete", msg)
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete", true)
|
||||
},
|
||||
doDeleteData() {
|
||||
var prm = {}
|
||||
prm.id = this.$store.state.patient.selected_patient.McuOfflinePrepareID
|
||||
prm.code = this.$store.state.patient.selected_patient.McuOfflinePrepareCode
|
||||
console.log(prm)
|
||||
this.$store.dispatch("patient/delete", prm)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
opendialoginfo: {
|
||||
get() {
|
||||
return this.$store.state.patient.open_dialog_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_open_dialog_info",false)
|
||||
}
|
||||
},
|
||||
msginfo: {
|
||||
get() {
|
||||
return this.$store.state.patient.msg_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_msg_info",false)
|
||||
}
|
||||
},
|
||||
xidentifer() {
|
||||
return this.$store.state.patient.error_identifier
|
||||
},
|
||||
kelainanCount() {
|
||||
return this.$store.state.patient.kelainan_count;
|
||||
},
|
||||
activeEncryptKey() {
|
||||
return this.$store.state.patient.active_encrypt_key;
|
||||
},
|
||||
xmgmmcu() {
|
||||
return this.$store.state.patient.mgmmcu
|
||||
},
|
||||
selected_mgmmcu: {
|
||||
get() {
|
||||
return this.$store.state.patient.selected_mgmmcu
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_selected_mgmmcu", val)
|
||||
this.$store.commit("patient/update_selected_mgm_mcu_id", val ? val.Mgm_McuID : null)
|
||||
|
||||
// Pastikan 'val' adalah objek yang valid dan memiliki ID
|
||||
if (val && val.Mgm_McuID) {
|
||||
this.$store.dispatch("patient/getcountkelainan", {
|
||||
Mgm_McuID: val.Mgm_McuID,
|
||||
company_id: val.Mgm_McuCorporateID
|
||||
});
|
||||
this.$store.dispatch("patient/getActiveEncryptKey", {
|
||||
Mgm_McuID: val.Mgm_McuID
|
||||
});
|
||||
this.$store.dispatch("patient/getKelainanSelected", {
|
||||
mgm_mcu_id: val.Mgm_McuID
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
setupcode: {
|
||||
get() {
|
||||
return this.$store.state.patient.setupcode
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_setupcode", val)
|
||||
}
|
||||
},
|
||||
xsetup() {
|
||||
return this.$store.state.patient.data_setup
|
||||
},
|
||||
dialogconfirmationdelete: {
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_confirmation_delete
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete", val)
|
||||
}
|
||||
},
|
||||
msgconfirmationdelete() {
|
||||
return this.$store.state.patient.msg_confirmation_delete
|
||||
},
|
||||
status: {
|
||||
get() {
|
||||
return this.$store.state.patient.status
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_status", val)
|
||||
this.$store.dispatch("patient/search", {
|
||||
status: val,
|
||||
current_page: this.curr_page,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
},
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_success", val)
|
||||
}
|
||||
},
|
||||
msgsuccess() {
|
||||
return this.$store.state.patient.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.patient.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.patient.search_status == 1
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.patient.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_open_alert_confirmation", val)
|
||||
}
|
||||
},
|
||||
loading_save: {
|
||||
get() {
|
||||
return this.$store.state.patient.loading_save
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_loading_save", val)
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
filters: {
|
||||
capitalize: function (str) {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1)
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
files: [],
|
||||
dialog_identifier: false,
|
||||
channel_name: '',
|
||||
channel_fields: [],
|
||||
channel_entries: [],
|
||||
parse_header: [],
|
||||
parse_csv: [],
|
||||
sortOrders:{},
|
||||
sortKey: '',
|
||||
statuses:[{id:"N",name:"Belum di download"},{id:"Y",name:"Sudah di download"}],
|
||||
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
items: [],
|
||||
name: '',
|
||||
snorm: '',
|
||||
page: 1,
|
||||
headers: [
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "50%",
|
||||
class: "pa-2 deep-orange accent-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "KTP",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "50%",
|
||||
class: "pa-2 deep-orange accent-1 white--text"
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'M_PatientName',
|
||||
totalItems: this.$store.state.patient.total_patients
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
3
test/vuex/cpone-mcu-generate-summaries/csv-mcu.csv
Normal file
3
test/vuex/cpone-mcu-generate-summaries/csv-mcu.csv
Normal file
@@ -0,0 +1,3 @@
|
||||
PID,NAMA,TANGGAL_LAHIR,JENIS_KELAMIN,NIK,JABATAN,EMAIL,HP,LOKASI,JOB,KEDUDUKAN
|
||||
,AA,12-09-2001,P,,GURU,,,,,
|
||||
,BB,14-01-1994,L,12.14.44.55,DIRKEU,,,,,
|
||||
|
BIN
test/vuex/cpone-mcu-generate-summaries/csv-mcu.xls
Normal file
BIN
test/vuex/cpone-mcu-generate-summaries/csv-mcu.xls
Normal file
Binary file not shown.
BIN
test/vuex/cpone-mcu-generate-summaries/csv-mcu.xlsx
Normal file
BIN
test/vuex/cpone-mcu-generate-summaries/csv-mcu.xlsx
Normal file
Binary file not shown.
118
test/vuex/cpone-mcu-generate-summaries/index.php
Normal file
118
test/vuex/cpone-mcu-generate-summaries/index.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<!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/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-content style="background:#F5E8DF!important" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs3 class="left" fill-height pa-1>
|
||||
<one-md-patient-list></one-md-patient-list>
|
||||
</v-flex>
|
||||
<v-flex xs9 class="right" fill-height pa-1>
|
||||
<one-md-patient-detail></one-md-patient-detail>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<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/vendor/sheetjs-master/xlsx.full.min.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;
|
||||
var ts = "?ts=" + Date.now();
|
||||
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
methods: {
|
||||
tab_selected : function(tab) {
|
||||
return this.$store.state.tab_selected == tab
|
||||
}
|
||||
},
|
||||
|
||||
mounted: function() {
|
||||
|
||||
|
||||
var url_string = window.location.href
|
||||
var url = new URL(url_string);
|
||||
var code = url.searchParams.get("code");
|
||||
|
||||
if (code != null) {
|
||||
this.$store.commit('order/update_setupcode', code)
|
||||
this.$store.commit("patient/update_patients", [])
|
||||
this.$store.commit("patient/update_total_patients", 0)
|
||||
this.$store.commit("patient/update_current_page", 1)
|
||||
this.$store.dispatch("patient/generatesetup", {
|
||||
setupcode : code
|
||||
})
|
||||
}
|
||||
if (!one_token())
|
||||
location.replace('/one-ui/test/vuex/one-login')
|
||||
},
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-md-patient-list': httpVueLoader('./components/oneMdPatientList.vue' + ts),
|
||||
'one-md-patient-detail': httpVueLoader('./components/oneMdPatientDetail.vue'),
|
||||
'one-md-patient-address': httpVueLoader('./components/oneMdPatientAddress.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
test/vuex/cpone-mcu-generate-summaries/mcu_template.xlsx
Normal file
BIN
test/vuex/cpone-mcu-generate-summaries/mcu_template.xlsx
Normal file
Binary file not shown.
BIN
test/vuex/cpone-mcu-generate-summaries/mcu_template_default.xlsx
Normal file
BIN
test/vuex/cpone-mcu-generate-summaries/mcu_template_default.xlsx
Normal file
Binary file not shown.
BIN
test/vuex/cpone-mcu-generate-summaries/mcu_template_west.xlsx
Normal file
BIN
test/vuex/cpone-mcu-generate-summaries/mcu_template_west.xlsx
Normal file
Binary file not shown.
1051
test/vuex/cpone-mcu-generate-summaries/modules/patient.js
Normal file
1051
test/vuex/cpone-mcu-generate-summaries/modules/patient.js
Normal file
File diff suppressed because it is too large
Load Diff
27
test/vuex/cpone-mcu-generate-summaries/store.js
Normal file
27
test/vuex/cpone-mcu-generate-summaries/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import patient from "./modules/patient.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
patient: patient,
|
||||
system: system
|
||||
},
|
||||
state: {
|
||||
tab_selected: 'pasien-dokter'
|
||||
},
|
||||
mutations: {
|
||||
change_tab(state, ntab) {
|
||||
state.tab_selected = ntab
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
change_tab(context, ntab) {
|
||||
context.commit('change_tab', ntab)
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -89,7 +89,7 @@
|
||||
<v-layout pa-1 row>
|
||||
<v-flex class="text-xs-center" xs12>
|
||||
<p class="mb-0 caption">silahkan download template di <span @click="downloadcsv()" style="cursor:pointer" class="info--text lighten-3--text">sini</span></p>
|
||||
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
@@ -100,7 +100,7 @@
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="opendialoginfo = false"></one-dialog-info>
|
||||
</v-layout>
|
||||
@@ -124,7 +124,7 @@
|
||||
mounted() {
|
||||
//this.setNewSetup()
|
||||
this.$store.dispatch("patient/getmgmmcu")
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
downloadxapp(){
|
||||
@@ -152,7 +152,7 @@
|
||||
this.$store.commit("patient/update_mou", {})
|
||||
this.$store.commit("patient/update_selected_mous", row.mous)
|
||||
this.$store.commit("patient/update_selected_doctors", row.doctors)
|
||||
|
||||
|
||||
this.$store.commit("patient/update_start_date", moment(row.McuOfflinePrepareStartDate).format('YYYY-MM-DD'))
|
||||
this.$store.commit("patient/update_end_date", moment(row.McuOfflinePrepareEndDate).format('YYYY-MM-DD'))
|
||||
},
|
||||
@@ -227,27 +227,27 @@
|
||||
var lines = csv.split("\n")
|
||||
var result = []
|
||||
var headers = lines[0].split(",")
|
||||
vm.parse_header = lines[0].split(",")
|
||||
vm.parse_header = lines[0].split(",")
|
||||
lines[0].split(",").forEach(function (key) {
|
||||
vm.sortOrders[key] = 1
|
||||
})
|
||||
|
||||
|
||||
lines.map(function(line, indexLine){
|
||||
if (indexLine < 1) return // Jump header line
|
||||
|
||||
|
||||
var obj = {}
|
||||
var currentline = line.split(",")
|
||||
|
||||
|
||||
headers.map(function(header, indexHeader){
|
||||
var header = header.trim();
|
||||
obj[header] = currentline[indexHeader]
|
||||
})
|
||||
|
||||
|
||||
result.push(obj)
|
||||
})
|
||||
|
||||
|
||||
result.pop() // remove the last item because undefined values
|
||||
|
||||
|
||||
return result // JavaScript object
|
||||
},
|
||||
loadCSV_old(e) {
|
||||
@@ -280,23 +280,23 @@
|
||||
// var d = substr(nik, 6, 2);
|
||||
// var m = substr(nik, 8, 2);
|
||||
// var y = substr(nik, 10, 2);
|
||||
|
||||
|
||||
// //jika tahun full, ambil 2 digit terakhir
|
||||
// if(strlen(tahun==4)){
|
||||
// tahun = substr(tahun,2,2);
|
||||
// }
|
||||
// if (intval(d) > 40) {
|
||||
// //Wanita
|
||||
// d = intval(d) - 40;
|
||||
// d = intval(d) - 40;
|
||||
// }
|
||||
// if(tanggal/d != 1){
|
||||
// return false;
|
||||
// }
|
||||
|
||||
|
||||
// if(bulan/m != 1){
|
||||
// return false;
|
||||
// }
|
||||
|
||||
|
||||
// if(tahun/y != 1){
|
||||
// return false;
|
||||
// }
|
||||
@@ -361,7 +361,7 @@
|
||||
if(iidx > 0){
|
||||
//entry.TANGGAL_LAHIR = moment(entry.TANGGAL_LAHIR).format('DD-MM-YYYY')
|
||||
// console.log("DD", moment(entry.TANGGAL_LAHIR, 'DD-MM-YYYY').format('DD'));
|
||||
|
||||
|
||||
// const date = new Date(entry.TANGGAL_LAHIR);
|
||||
// console.log("date",date)
|
||||
var day = moment(entry.TANGGAL_LAHIR, 'DD-MM-YYYY').format('DD');
|
||||
@@ -508,7 +508,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
files: [],
|
||||
files: [],
|
||||
dialog_identifier: false,
|
||||
channel_name: '',
|
||||
channel_fields: [],
|
||||
@@ -551,4 +551,4 @@
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
366
test/vuex/cpone-mcu-offline-preregister-v3/api/patient.js
Normal file
366
test/vuex/cpone-mcu-offline-preregister-v3/api/patient.js
Normal file
@@ -0,0 +1,366 @@
|
||||
const URL = "/one-api/cpone/mcuoffline/";
|
||||
|
||||
export async function getmgmmcu(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/getmgmmcu', prm);
|
||||
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(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/search', prm);
|
||||
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 generatesetup(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/generatesetup', prm);
|
||||
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 getsexreg(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/getsexreg',{token:token});
|
||||
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 savecsv(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/savecsv',prm);
|
||||
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 newpatient(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/newpatient',prm);
|
||||
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 xdelete(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/deletepatient',prm);
|
||||
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 getaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/getaddress',prm);
|
||||
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 searchcity(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/searchcity',{token:token,search:prm});
|
||||
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 getdistrict(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/getdistrict',{id:prm.M_CityID,token:token});
|
||||
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 getkelurahan(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/getkelurahan',{token:token,id:prm.M_DistrictID});
|
||||
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 savenewaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/savenewaddress',prm);
|
||||
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 saveeditaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/saveeditaddress',prm);
|
||||
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 deleteaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/deleteaddress',prm);
|
||||
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 searchdoctor(prm) {
|
||||
try {
|
||||
console.log('aye')
|
||||
console.log(prm)
|
||||
var resp = await axios.post(URL + 'preregisterv3/searchdoctor',prm);
|
||||
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 searchcompany(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/searchcompany',prm);
|
||||
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 getmou(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/getmou',prm);
|
||||
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 savepreregisterv2(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/savepreregisterv2',prm);
|
||||
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 gotoreg(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'preregisterv3/gotoreg',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
<template>
|
||||
<div class="vue-csv-uploader">
|
||||
<div class="form">
|
||||
<div class="vue-csv-uploader-part-one">
|
||||
<div class="form-check form-group csv-import-checkbox" v-if="headers === null">
|
||||
<slot name="hasHeaders" :headers="hasHeaders" :toggle="toggleHasHeaders">
|
||||
<input :class="checkboxClass" type="checkbox" :id="makeId('hasHeaders')" :value="hasHeaders" @change="toggleHasHeaders">
|
||||
<label class="form-check-label" :for="makeId('hasHeaders')">
|
||||
File Has Headers
|
||||
</label>
|
||||
</slot>
|
||||
</div>
|
||||
<div class="form-group csv-import-file">
|
||||
<input ref="csv" type="file" @change.prevent="validFileMimeType" :class="inputClass" name="csv">
|
||||
<slot name="error" v-if="showErrorMessage">
|
||||
<div class="invalid-feedback d-block">
|
||||
File type is invalid
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<slot name="next" :load="load">
|
||||
<button type="submit" :disabled="disabledNextButton" :class="buttonClass" @click.prevent="load">
|
||||
{{ loadBtnText }}
|
||||
</button>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
<div class="vue-csv-uploader-part-two">
|
||||
<div class="vue-csv-mapping" v-if="sample">
|
||||
<table :class="tableClass">
|
||||
<slot name="thead">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>CSV Column</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</slot>
|
||||
<tbody>
|
||||
<tr v-for="(field, key) in fieldsToMap" :key="key">
|
||||
<td>{{ field.label }}</td>
|
||||
<td>
|
||||
<select :class="tableSelectClass" :name="`csv_uploader_map_${key}`" v-model="map[field.key]">
|
||||
<option :value="null" v-if="canIgnore">Ignore</option>
|
||||
<option v-for="(column, key) in firstRow" :key="key" :value="key">{{ column }}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="form-group" v-if="url">
|
||||
<slot name="submit" :submit="submit">
|
||||
<input type="submit" :class="buttonClass" @click.prevent="submit" :value="submitBtnText">
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { drop, every, forEach, get, isArray, map, set } from 'lodash';
|
||||
import axios from 'axios';
|
||||
import Papa from 'papaparse';
|
||||
import mimeTypes from "mime-types";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: Array,
|
||||
url: {
|
||||
type: String
|
||||
},
|
||||
mapFields: {
|
||||
required: true
|
||||
},
|
||||
callback: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
catch: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
finally: {
|
||||
type: Function,
|
||||
default: () => ({})
|
||||
},
|
||||
parseConfig: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
headers: {
|
||||
default: null
|
||||
},
|
||||
loadBtnText: {
|
||||
type: String,
|
||||
default: "Next"
|
||||
},
|
||||
submitBtnText: {
|
||||
type: String,
|
||||
default: "Submit"
|
||||
},
|
||||
tableClass: {
|
||||
type: String,
|
||||
default: "table"
|
||||
},
|
||||
checkboxClass: {
|
||||
type: String,
|
||||
default: "form-check-input"
|
||||
},
|
||||
buttonClass: {
|
||||
type: String,
|
||||
default: "btn btn-primary"
|
||||
},
|
||||
inputClass: {
|
||||
type: String,
|
||||
default: "form-control-file"
|
||||
},
|
||||
validation: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
fileMimeTypes: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return ["text/csv", "text/x-csv", "application/vnd.ms-excel", "text/plain"];
|
||||
}
|
||||
},
|
||||
tableSelectClass: {
|
||||
type: String,
|
||||
default: 'form-control'
|
||||
},
|
||||
canIgnore: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
|
||||
data: () => ({
|
||||
form: {
|
||||
csv: null,
|
||||
},
|
||||
fieldsToMap: [],
|
||||
map: {},
|
||||
hasHeaders: true,
|
||||
csv: null,
|
||||
sample: null,
|
||||
isValidFileMimeType: false,
|
||||
fileSelected: false
|
||||
}),
|
||||
|
||||
created() {
|
||||
this.hasHeaders = this.headers;
|
||||
|
||||
if (isArray(this.mapFields)) {
|
||||
this.fieldsToMap = map(this.mapFields, (item) => {
|
||||
return {
|
||||
key: item,
|
||||
label: item
|
||||
};
|
||||
});
|
||||
} else {
|
||||
this.fieldsToMap = map(this.mapFields, (label, key) => {
|
||||
return {
|
||||
key: key,
|
||||
label: label
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
const _this = this;
|
||||
this.form.csv = this.buildMappedCsv();
|
||||
this.$emit('input', this.form.csv);
|
||||
|
||||
if (this.url) {
|
||||
axios.post(this.url, this.form).then(response => {
|
||||
_this.callback(response);
|
||||
}).catch(response => {
|
||||
_this.catch(response);
|
||||
}).finally(response => {
|
||||
_this.finally(response);
|
||||
});
|
||||
} else {
|
||||
_this.callback(this.form.csv);
|
||||
}
|
||||
},
|
||||
buildMappedCsv() {
|
||||
const _this = this;
|
||||
|
||||
let csv = this.hasHeaders ? drop(this.csv) : this.csv;
|
||||
|
||||
return map(csv, (row) => {
|
||||
let newRow = {};
|
||||
|
||||
forEach(_this.map, (column, field) => {
|
||||
set(newRow, field, get(row, column));
|
||||
});
|
||||
|
||||
return newRow;
|
||||
});
|
||||
},
|
||||
validFileMimeType() {
|
||||
let file = this.$refs.csv.files[0];
|
||||
const mimeType = file.type === "" ? mimeTypes.lookup(file.name) : file.type;
|
||||
|
||||
if (file) {
|
||||
this.fileSelected = true;
|
||||
this.isValidFileMimeType = this.validation ? this.validateMimeType(mimeType) : true;
|
||||
} else {
|
||||
this.isValidFileMimeType = !this.validation;
|
||||
this.fileSelected = false;
|
||||
}
|
||||
},
|
||||
validateMimeType(type) {
|
||||
return this.fileMimeTypes.indexOf(type) > -1;
|
||||
},
|
||||
load() {
|
||||
const _this = this;
|
||||
|
||||
this.readFile((output) => {
|
||||
_this.sample = get(Papa.parse(output, { preview: 2, skipEmptyLines: true }), "data");
|
||||
_this.csv = get(Papa.parse(output, { skipEmptyLines: true }), "data");
|
||||
});
|
||||
},
|
||||
readFile(callback) {
|
||||
let file = this.$refs.csv.files[0];
|
||||
|
||||
if (file) {
|
||||
let reader = new FileReader();
|
||||
reader.readAsText(file, "UTF-8");
|
||||
reader.onload = function (evt) {
|
||||
callback(evt.target.result);
|
||||
};
|
||||
reader.onerror = function () {
|
||||
};
|
||||
}
|
||||
},
|
||||
toggleHasHeaders() {
|
||||
this.hasHeaders = !this.hasHeaders;
|
||||
},
|
||||
makeId(id) {
|
||||
return `${id}${this._uid}`;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
map: {
|
||||
deep: true,
|
||||
handler: function (newVal) {
|
||||
if (!this.url) {
|
||||
let hasAllKeys = Array.isArray(this.mapFields) ? every(this.mapFields, function (item) {
|
||||
return newVal.hasOwnProperty(item);
|
||||
}) : every(this.mapFields, function (item, key) {
|
||||
return newVal.hasOwnProperty(key);
|
||||
});
|
||||
|
||||
if (hasAllKeys) {
|
||||
this.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
sample(newVal, oldVal) {
|
||||
if(newVal !== null){
|
||||
this.fieldsToMap.forEach(field => {
|
||||
newVal[0].forEach((columnName, index) => {
|
||||
if(field.key === columnName){
|
||||
this.map[field.key] = index;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
firstRow() {
|
||||
return get(this, "sample.0");
|
||||
},
|
||||
showErrorMessage() {
|
||||
return this.fileSelected && !this.isValidFileMimeType;
|
||||
},
|
||||
disabledNextButton() {
|
||||
return !this.isValidFileMimeType;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,397 @@
|
||||
<template>
|
||||
<v-layout v-if="xact !== 'new'" column >
|
||||
<v-dialog v-model="dialogconfirmationdeleteaddr" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title
|
||||
dark
|
||||
class="headline error pt-2 pb-2"
|
||||
primary-title
|
||||
style="color:white"
|
||||
>
|
||||
<h4 dark>Konfirmasi</h4>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgconfirmationdeleteaddr}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small v-if="!checkError('deleteutama')" color="error darken-1 text-sm-left" flat @click="doDeleteAddr()">Hapus</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeleteaddr = false">Batal</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogformaddress" persistent max-width="650">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Alamat Pasien</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="labeladdress" label="Label"></v-text-field>
|
||||
<p v-if="checkError('requiredlabel')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
<p v-if="checkError('readonlyutama')" class="error pl-2 pr-2" style="color:#fff">Biarkan jadi yang utama</p>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout row>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-autocomplete
|
||||
label="Kota"
|
||||
v-model="cityaddress"
|
||||
:items="xcities"
|
||||
:search-input.sync="search_city"
|
||||
auto-select-first
|
||||
no-filter
|
||||
item-text="M_CityName"
|
||||
return-object
|
||||
:loading="isLoading"
|
||||
no-data-text="Pilih Kota"
|
||||
>
|
||||
<template
|
||||
slot="item"
|
||||
slot-scope="{ item }"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CityName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
<p v-if="checkError('requiredcity')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-select
|
||||
item-text="M_DistrictName"
|
||||
return-object
|
||||
:items="xdistricts"
|
||||
v-model="districtaddress"
|
||||
label="Kecamatan*"
|
||||
></v-select>
|
||||
<p v-if="checkError('requireddistrict')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-select
|
||||
item-text="M_KelurahanName"
|
||||
return-object
|
||||
:items="xkelurahans"
|
||||
v-model="kelurahanaddress"
|
||||
label="Kelurahan / Desa*"
|
||||
></v-select>
|
||||
<p v-if="checkError('requiredkelurahan')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-textarea
|
||||
box
|
||||
label="Alamat Lengkap"
|
||||
v-model="descriptionaddress"
|
||||
></v-textarea>
|
||||
<p v-if="checkError('requireddescription')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="dialogformaddress = false">Tutup</v-btn>
|
||||
<v-btn v-if="xactaddr === 'new'" color="blue darken-1" flat @click="saveNewAddress()">Simpan</v-btn>
|
||||
<v-btn v-if="xactaddr === 'edit'" color="blue darken-1" flat @click="saveEditAddress()">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-subheader red--text text--lighten-1> ALAMAT PASIEN
|
||||
<v-flex text-md-right>
|
||||
<v-btn @click="createNewAddress()" small color="info">Baru</v-btn>
|
||||
</v-flex>
|
||||
</v-subheader>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="xaddresses"
|
||||
:loading="isLoading"
|
||||
hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-icon color="error" @click="deleteAddress(props.item)">delete</v-icon>
|
||||
<v-icon class="ml-3" color="primary" @click="editAddress(props.item)">edit</v-icon>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.M_PatientAddressNote}}</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.M_PatientAddressDescription}}</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-flex>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
search_city:'',
|
||||
oldlabel:'',
|
||||
headers: [
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "action",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "LABEL",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "ALAMAT",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "40%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
}),
|
||||
computed: {
|
||||
dialogconfirmationdeleteaddr:{
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_confirmation_delete_addr
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete_addr",val)
|
||||
}
|
||||
},
|
||||
msgconfirmationdeleteaddr(){
|
||||
return this.$store.state.patient.msg_confirmation_delete_addr
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.patient.act
|
||||
},
|
||||
xactaddr() {
|
||||
return this.$store.state.patient.act_addr
|
||||
},
|
||||
dialogformaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_form_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_form_address",val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.patient.search_status == 1
|
||||
},
|
||||
xaddresses(p) {
|
||||
return this.$store.state.patient.addresses
|
||||
},
|
||||
xcities(){
|
||||
return this.$store.state.patient.cities
|
||||
},
|
||||
labeladdress:{
|
||||
get() {
|
||||
return this.$store.state.patient.label_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_label_address",val)
|
||||
}
|
||||
},
|
||||
cityaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.city_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_city_address",val)
|
||||
this.$store.dispatch("patient/getdistrict",this.$store.state.patient.city_address)
|
||||
}
|
||||
},
|
||||
xdistricts(){
|
||||
return this.$store.state.patient.districts
|
||||
},
|
||||
districtaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.district_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_district_address",val)
|
||||
this.$store.dispatch("patient/getkelurahan",this.$store.state.patient.district_address)
|
||||
}
|
||||
},
|
||||
xkelurahans(){
|
||||
return this.$store.state.patient.kelurahans
|
||||
},
|
||||
kelurahanaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.kelurahan_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_kelurahan_address",val)
|
||||
}
|
||||
},
|
||||
descriptionaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.description_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_description_address",val)
|
||||
}
|
||||
},
|
||||
},
|
||||
methods : {
|
||||
createNewAddress(){
|
||||
this.$store.commit("patient/update_act_addr",'new')
|
||||
this.search_city = ''
|
||||
this.labeladdress = ''
|
||||
this.$store.commit("patient/update_cities",[])
|
||||
this.cityaddress = {}
|
||||
this.$store.commit("patient/update_districts",[])
|
||||
this.districtaddress = {}
|
||||
this.$store.commit("patient/update_kelurahans",[])
|
||||
this.kelurahanaddress = {}
|
||||
this.descriptionaddress = ''
|
||||
this.$store.commit("patient/update_dialog_form_address",true)
|
||||
},
|
||||
thr_search_city: _.debounce( function () {
|
||||
this.$store.dispatch("patient/searchcity",this.search_city)
|
||||
},2000),
|
||||
checkError(value){
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(errors.includes(value)){
|
||||
return true
|
||||
}
|
||||
else{
|
||||
return false
|
||||
}
|
||||
},
|
||||
saveNewAddress(){
|
||||
this.$store.commit("patient/update_errors",[])
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(this.labeladdress === ''){
|
||||
errors.push("requiredlabel")
|
||||
}
|
||||
if(_.isEmpty(this.cityaddress)){
|
||||
errors.push("requiredcity")
|
||||
}
|
||||
if(_.isEmpty(this.districtaddress)){
|
||||
errors.push("requireddistrict")
|
||||
}
|
||||
if(_.isEmpty(this.kelurahanaddress)){
|
||||
errors.push("requiredkelurahan")
|
||||
}
|
||||
if(_.isEmpty(this.descriptionaddress)){
|
||||
errors.push("requireddescription")
|
||||
}
|
||||
|
||||
if(errors.length === 0){
|
||||
var prm = {}
|
||||
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
|
||||
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
|
||||
prm.M_PatientAddressNote = this.labeladdress
|
||||
prm.M_PatientAddressDescription = this.descriptionaddress
|
||||
prm.M_PatientAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
|
||||
this.$store.dispatch("patient/savenewaddress",prm)
|
||||
}
|
||||
},
|
||||
editAddress(value){
|
||||
this.$store.commit("patient/update_act_addr",'edit')
|
||||
this.$store.commit("patient/update_x_addr_id",value.M_PatientAddressID)
|
||||
this.labeladdress = value.M_PatientAddressNote
|
||||
this.oldlabel = value.M_PatientAddressNote
|
||||
this.$store.commit("patient/update_cities",[{M_CityID:value.M_CityID,M_CityName:value.M_CityName}])
|
||||
this.cityaddress = {M_CityID:value.M_CityID,M_CityName:value.M_CityName}
|
||||
this.$store.commit("patient/update_districts",[{M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}])
|
||||
this.districtaddress = {M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}
|
||||
this.$store.commit("patient/update_kelurahans",[{M_KelurahanID:value.M_PatientAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}])
|
||||
this.kelurahanaddress = {M_KelurahanID:value.M_PatientAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}
|
||||
this.descriptionaddress = value.M_PatientAddressDescription
|
||||
this.$store.commit("patient/update_dialog_form_address",true)
|
||||
},
|
||||
saveEditAddress(){
|
||||
this.$store.commit("patient/update_errors",[])
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(this.labeladdress === ''){
|
||||
errors.push("requiredlabel")
|
||||
}
|
||||
if(this.oldlabel.toLowerCase() === 'utama' && this.labeladdress.toLowerCase() !== 'utama'){
|
||||
errors.push("readonlyutama")
|
||||
}
|
||||
if(_.isEmpty(this.cityaddress)){
|
||||
errors.push("requiredcity")
|
||||
}
|
||||
if(_.isEmpty(this.districtaddress)){
|
||||
errors.push("requireddistrict")
|
||||
}
|
||||
if(_.isEmpty(this.kelurahanaddress)){
|
||||
errors.push("requiredkelurahan")
|
||||
}
|
||||
if(_.isEmpty(this.descriptionaddress)){
|
||||
errors.push("requireddescription")
|
||||
}
|
||||
|
||||
if(errors.length === 0){
|
||||
var prm = {}
|
||||
prm.M_PatientAddressID = this.$store.state.patient.x_addr_id
|
||||
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
|
||||
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
|
||||
prm.M_PatientAddressNote = this.labeladdress
|
||||
prm.M_PatientAddressDescription = this.descriptionaddress
|
||||
prm.M_PatientAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
|
||||
this.$store.dispatch("patient/saveeditaddress",prm)
|
||||
}
|
||||
},
|
||||
deleteAddress(value){
|
||||
this.$store.commit("patient/update_act_addr",'delete')
|
||||
this.$store.commit("patient/update_x_addr_id",value.M_PatientAddressID)
|
||||
this.$store.commit("patient/update_errors",[])
|
||||
this.oldlabel = value.M_PatientAddressNote
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(value.M_PatientAddressNote.toLowerCase() === 'utama'){
|
||||
errors.push("deleteutama")
|
||||
}
|
||||
var msg = ''
|
||||
if(errors.includes("deleteutama")){
|
||||
msg = "Biarkan yang utama tetap ada"
|
||||
}
|
||||
else{
|
||||
msg = "Yakin, akan menghapus data alamat pasien "+value.M_PatientAddressNote+" ?"
|
||||
}
|
||||
|
||||
this.$store.commit("patient/update_msg_confirmation_delete_addr",msg)
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete_addr",true)
|
||||
},
|
||||
doDeleteAddr(){
|
||||
var prm = {}
|
||||
prm.M_PatientAddressID = this.$store.state.patient.x_addr_id
|
||||
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
|
||||
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
|
||||
prm.M_PatientAddressNote = this.oldlabel
|
||||
this.$store.dispatch("patient/deleteaddress",prm)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
search_city(val,old) {
|
||||
if (val == old ) return
|
||||
if (! val) return
|
||||
if (val.length < 1 ) return
|
||||
if (this.$store.state.patient.update_autocomplete_status == 1 ) return
|
||||
this.thr_search_city()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<v-layout class="mb-2" column>
|
||||
<v-card >
|
||||
<v-card-title style="background:#57c492">
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-text-field
|
||||
color="teal"
|
||||
label="Cari pasien"
|
||||
v-model="xsearch"
|
||||
@keyup.enter="searchPatientTable()"
|
||||
outline
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="patients"
|
||||
hide-actions
|
||||
class="elevation-1"
|
||||
>
|
||||
<template v-slot:items="props">
|
||||
<td class="text-xs-left">{{ props.item.Mcu_PreregisterPatientsPatientName }}</td>
|
||||
<td class="text-xs-center">{{ props.item.dob }}</td>
|
||||
<td class="text-xs-center">{{ props.item.Mcu_PreregisterPatientsGender }}</td>
|
||||
<td class="text-xs-center">{{ props.item.Mcu_PreregisterPatientsNIP }}</td>
|
||||
<td class="text-xs-left">{{ props.item.Mcu_PreregisterPatientsPosisi }}</td>
|
||||
<td class="text-xs-center">
|
||||
<!-- <v-btn small dark v-if="props.item.Mcu_PreregisterPatientsFlagAction === 'N'" @click="goToRegister(props.item)" color="#03989e">DAFTARKAN</v-btn> -->
|
||||
<v-btn small dark v-if="props.item.Mcu_PreregisterPatientsFlagAction === 'R'" color="#57c492">SEDANG DIPROSES</v-btn>
|
||||
<v-btn small disabled v-if="props.item.Mcu_PreregisterPatientsFlagAction === 'S'" color="grey">TELAH SELESAI</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-pagination style="margin-top:10px;margin-bottom:10px"
|
||||
color="#57c492"
|
||||
:total-visible="15"
|
||||
v-model="curr_page"
|
||||
:length="xtotal_page">
|
||||
</v-pagination>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
table,
|
||||
td,
|
||||
th {
|
||||
border: 0px solid #ddd;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 8px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.mini-input .v-input {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.mini-input .v-input,
|
||||
.mini-input .v-input--selection-controls,
|
||||
.mini-input .v-input__slot {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.mini-input .v-messages {
|
||||
min-height: 0px;
|
||||
}
|
||||
|
||||
input.fhm-input {
|
||||
border: 1px solid black;
|
||||
border-radius: 2px;
|
||||
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
|
||||
0 0 4px rgba(0, 0, 0, 0.1);
|
||||
-moz-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
|
||||
0 0 4px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
|
||||
0 0 4px rgba(0, 0, 0, 0.1);
|
||||
padding: 2px 4px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
margin: 0 0 1px 0;
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data () {
|
||||
return {
|
||||
search: '',
|
||||
pagination: {},
|
||||
selected: [],
|
||||
headers: [
|
||||
{ text: 'NAMA',width:'20%',align:'center',sortable: false},
|
||||
{ text: 'TANGGAL LAHIR',width:'10%',align:'center',sortable: false},
|
||||
{ text: 'JENIS KEL.',width:'10%',align:'center',sortable: false},
|
||||
{ text: 'NIP',width:'10%',align:'center',sortable: false},
|
||||
{ text: 'POSISI',width:'18%',align:'center',sortable: false},
|
||||
{ text: 'STATUS',width:'10%',align:'center',sortable: false}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
patients() {
|
||||
return this.$store.state.patient.patients
|
||||
},
|
||||
totalpatient() {
|
||||
return this.$store.state.patient.total_patient
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.patient.current_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_current_page", val)
|
||||
this.$store.dispatch("patient/search", {
|
||||
search:this.$store.state.patient.search,
|
||||
xid:this.$store.state.patient.data_setup.McuOfflinePrepareID,
|
||||
current_page: val,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.patient.total_patient
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_total_patient", val)
|
||||
}
|
||||
},
|
||||
xsearch: {
|
||||
get() {
|
||||
return this.$store.state.patient.search
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_search", val)
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
gotoReg(row) {
|
||||
this.$store.dispatch("patient/gotoreg", row)
|
||||
},
|
||||
goToRegister(row){
|
||||
var prm = this.$store.state.patient.selected_patient_listing
|
||||
var setup = this.$store.state.patient.data_setup
|
||||
var pre_id = row.Mcu_PreregisterPatientsID
|
||||
// var code = setup.McuOfflinePrepareCode
|
||||
location.replace("/one-ui/test/vuex/one-fo-registration-v8/" + "?pre_id=" +pre_id)
|
||||
},
|
||||
searchPatientTable(){
|
||||
this.curr_page = 1
|
||||
this.$store.dispatch("patient/search", {
|
||||
search: this.xsearch,
|
||||
current_page: this.curr_page,
|
||||
xid:this.$store.state.patient.data_setup.McuOfflinePrepareID,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,559 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-dialog
|
||||
v-model="dialog_identifier"
|
||||
width="800"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
GAGAL, KTP DAN TANGGAL LAHIR HARUS BENAR!!!
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout align-center row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="xidentifer" hide-actions
|
||||
class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" v-html="props.item.NAMA"></td>
|
||||
<td class="text-xs-left pa-2" v-html="props.item.KTP"></td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="primary"
|
||||
flat
|
||||
@click="dialog_identifier = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<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 color="orange accent-1" class="mb-2 pa-2 searchbox">
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-card>
|
||||
<v-layout pa-2 row>
|
||||
<v-flex xs12>
|
||||
<v-autocomplete :items="xmgmmcu" v-model="selected_mgmmcu" item-text="mcuName" outline
|
||||
item-value="Mgm_McuID" return-object label="MCU">
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-card color="orange" dark>
|
||||
<v-card-text>
|
||||
<v-layout align-center row>
|
||||
<v-flex pb-2 xs12>
|
||||
SETUP : {{selected_mgmmcu.Mgm_McuLabel}}
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider dark></v-divider>
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<p class="mb-0 caption"> Periode : {{selected_mgmmcu.Mgm_McuStartDate}} - {{selected_mgmmcu.Mgm_McuEndDate}}</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-card color="orange accent-1" class="mb-2 pa-2 searchbox">
|
||||
<v-layout pa-1 row>
|
||||
<v-flex class="text-xs-center" xs12>
|
||||
<p class="mb-0 caption">silahkan download template di <span @click="downloadcsv()" style="cursor:pointer" class="info--text lighten-3--text">sini</span></p>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout pt-2 pb-1 row>
|
||||
<v-flex class="text-xs-left" xs12>
|
||||
<input accept=".xlsx" type="file" id="csv_file" name="csv_file" class="form-control" @change="loadCSV($event)">
|
||||
<v-progress-circular v-if="loading_save" :indeterminate="true" color="primary"></v-progress-circular>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="opendialoginfo = false"></one-dialog-info>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
table.v-table tbody td,table.v-table tbody th {
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-dialog-info' : httpVueLoader('../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
|
||||
},
|
||||
mounted() {
|
||||
//this.setNewSetup()
|
||||
this.$store.dispatch("patient/getmgmmcu")
|
||||
|
||||
},
|
||||
methods: {
|
||||
downloadxapp(){
|
||||
var start = Date.now()
|
||||
location.replace("/install-mcu.zip?tm="+start)
|
||||
},
|
||||
generateSetup(){
|
||||
this.$store.commit("patient/update_patients", [])
|
||||
this.$store.commit("patient/update_total_patients", 0)
|
||||
this.$store.dispatch("patient/generatesetup", {
|
||||
setupcode : this.setupcode
|
||||
})
|
||||
},
|
||||
downloadcsv(){
|
||||
// window.open("./mcu_template.xlsx")
|
||||
window.open("./mcu_template_west.xlsx")
|
||||
},
|
||||
editRow(row){
|
||||
console.log(row)
|
||||
this.$store.commit("patient/update_act", 'edit')
|
||||
this.$store.commit("patient/update_xid", row.McuOfflinePrepareID)
|
||||
this.$store.commit("patient/update_companies", [{id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName}])
|
||||
this.$store.commit("patient/update_company", {id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName})
|
||||
this.$store.commit("patient/update_mous", row.allmous)
|
||||
this.$store.commit("patient/update_mou", {})
|
||||
this.$store.commit("patient/update_selected_mous", row.mous)
|
||||
this.$store.commit("patient/update_selected_doctors", row.doctors)
|
||||
|
||||
this.$store.commit("patient/update_start_date", moment(row.McuOfflinePrepareStartDate).format('YYYY-MM-DD'))
|
||||
this.$store.commit("patient/update_end_date", moment(row.McuOfflinePrepareEndDate).format('YYYY-MM-DD'))
|
||||
},
|
||||
isSelected(p) {
|
||||
return p.M_PatientID == this.$store.state.patient.selected_patient.M_PatientID
|
||||
},
|
||||
searchPatient() {
|
||||
this.$store.dispatch("patient/search", {
|
||||
status: this.status,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
this.$store.commit("patient/update_current_page", 1)
|
||||
},
|
||||
selectMe(pat) {
|
||||
if (this.$store.state.patient.no_save == 0) {
|
||||
this.$store.commit("patient/update_selected_patient", pat)
|
||||
} else {
|
||||
this.$store.commit("patient/update_open_alert_confirmation", true)
|
||||
}
|
||||
},
|
||||
closeAlertConfirmation() {
|
||||
this.$store.commit("patient/update_open_alert_confirmation", false)
|
||||
},
|
||||
forgetAlertConfirmation() {
|
||||
this.$store.commit("patient/update_no_save", 0)
|
||||
this.$store.commit("patient/update_open_alert_confirmation", false)
|
||||
},
|
||||
updateAlert_success(val) {
|
||||
this.$store.commit("patient/update_alert_success", val)
|
||||
},
|
||||
closeDialogSuccess() {
|
||||
let arrpatient = this.$store.state.patient.patients
|
||||
var idx = _.findIndex(arrpatient, item => item.M_PatientID === this.$store.state.patient.last_id)
|
||||
console.log(idx)
|
||||
this.$store.dispatch("patient/search", {
|
||||
status: this.status,
|
||||
current_page: this.curr_page,
|
||||
lastid: idx
|
||||
})
|
||||
this.$store.commit("patient/update_dialog_success", false)
|
||||
},
|
||||
setNewSetup(){
|
||||
this.$store.commit("patient/update_act", 'new')
|
||||
this.$store.commit("patient/update_xid", -1)
|
||||
this.$store.commit("patient/update_company", {})
|
||||
this.$store.commit("patient/update_mous", [])
|
||||
this.$store.commit("patient/update_mou", {})
|
||||
this.$store.commit("patient/update_default_mou", {})
|
||||
this.$store.commit("patient/update_default_doctor", {})
|
||||
this.$store.commit("patient/update_selected_mous", [])
|
||||
this.$store.commit("patient/update_selected_doctors", [])
|
||||
this.$store.commit("patient/update_start_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
this.$store.commit("patient/update_end_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
},
|
||||
deleteData(row) {
|
||||
this.$store.commit("patient/update_selected_patient", row)
|
||||
console.log(this.$store.state.patient.selected_patient)
|
||||
let msg = "Yakin, akan menghapus data setup " + this.$store.state.patient.selected_patient.McuOfflinePrepareCode + " ?"
|
||||
this.$store.commit("patient/update_msg_confirmation_delete", msg)
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete", true)
|
||||
},
|
||||
doDeleteData() {
|
||||
var prm = {}
|
||||
prm.id = this.$store.state.patient.selected_patient.McuOfflinePrepareID
|
||||
prm.code = this.$store.state.patient.selected_patient.McuOfflinePrepareCode
|
||||
console.log(prm)
|
||||
this.$store.dispatch("patient/delete", prm)
|
||||
},
|
||||
csvJSON(csv){
|
||||
var vm = this
|
||||
var lines = csv.split("\n")
|
||||
var result = []
|
||||
var headers = lines[0].split(",")
|
||||
vm.parse_header = lines[0].split(",")
|
||||
lines[0].split(",").forEach(function (key) {
|
||||
vm.sortOrders[key] = 1
|
||||
})
|
||||
|
||||
lines.map(function(line, indexLine){
|
||||
if (indexLine < 1) return // Jump header line
|
||||
|
||||
var obj = {}
|
||||
var currentline = line.split(",")
|
||||
|
||||
headers.map(function(header, indexHeader){
|
||||
var header = header.trim();
|
||||
obj[header] = currentline[indexHeader]
|
||||
})
|
||||
|
||||
result.push(obj)
|
||||
})
|
||||
|
||||
result.pop() // remove the last item because undefined values
|
||||
|
||||
return result // JavaScript object
|
||||
},
|
||||
loadCSV_old(e) {
|
||||
var vm = this
|
||||
if (window.FileReader) {
|
||||
var reader = new FileReader();
|
||||
reader.readAsText(e.target.files[0]);
|
||||
// Handle errors load
|
||||
reader.onload = function(event) {
|
||||
var csv = event.target.result;
|
||||
vm.parse_csv = vm.csvJSON(csv)
|
||||
var prm = {xid:vm.$store.state.patient.data_setup.McuOfflinePrepareID,data:vm.parse_csv}
|
||||
console.log(prm)
|
||||
vm.$store.dispatch("patient/savecsv", prm)
|
||||
};
|
||||
reader.onerror = function(evt) {
|
||||
if(evt.target.error.name == "NotReadableError") {
|
||||
alert("Canno't read file !");
|
||||
}
|
||||
};
|
||||
} else {
|
||||
alert('FileReader are not supported in this browser.');
|
||||
}
|
||||
},
|
||||
// Validasi KTP sederhana
|
||||
// cekKTP(nik,tanggal,bulan,tahun) {
|
||||
// if(strlen(nik) != 16){
|
||||
// return false;
|
||||
// }
|
||||
// var d = substr(nik, 6, 2);
|
||||
// var m = substr(nik, 8, 2);
|
||||
// var y = substr(nik, 10, 2);
|
||||
|
||||
// //jika tahun full, ambil 2 digit terakhir
|
||||
// if(strlen(tahun==4)){
|
||||
// tahun = substr(tahun,2,2);
|
||||
// }
|
||||
// if (intval(d) > 40) {
|
||||
// //Wanita
|
||||
// d = intval(d) - 40;
|
||||
// }
|
||||
// if(tanggal/d != 1){
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if(bulan/m != 1){
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if(tahun/y != 1){
|
||||
// return false;
|
||||
// }
|
||||
// //setelah berhasil melewati rintangan, berarti nomornya valid (tidak 100% valid)
|
||||
// return true;
|
||||
// },
|
||||
cekKTP(nik,tanggal,bulan,tahun) {
|
||||
return true;
|
||||
if (nik.length !== 16) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let d = parseInt(nik.substr(6, 2));
|
||||
let m = parseInt(nik.substr(8, 2));
|
||||
let y = parseInt(nik.substr(10, 2));
|
||||
|
||||
// Jika tahun full, ambil 2 digit terakhir
|
||||
if (tahun.toString().length === 4) {
|
||||
tahun = tahun.toString().substr(2, 2);
|
||||
}
|
||||
|
||||
if (d > 40) {
|
||||
// Wanita
|
||||
d = d + 40;
|
||||
}
|
||||
|
||||
if (parseInt(tanggal) !== d) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parseInt(bulan) !== m) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parseInt(tahun) !== y) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Setelah berhasil melewati rintangan, berarti nomornya valid (tidak 100% valid)
|
||||
return true;
|
||||
},
|
||||
loadCSV(e) {
|
||||
var vm = this
|
||||
var files = e.target.files, f = files[0];
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
var data = new Uint8Array(e.target.result);
|
||||
var workbook = XLSX.read(data, {type: 'array',cellText:true,cellDates: true});
|
||||
let sheetName = workbook.SheetNames[0]
|
||||
/* DO SOMETHING WITH workbook HERE */
|
||||
console.log(workbook);
|
||||
let worksheet = workbook.Sheets[sheetName];
|
||||
// console.log(XLSX.utils.sheet_to_json(worksheet));
|
||||
//var xdata = XLSX.utils.sheet_to_json(worksheet,{ raw:false, dateNF: 'FMT 22'})
|
||||
var data_json = []
|
||||
// console.log(xdata)
|
||||
var date_data = XLSX.utils.sheet_to_json(worksheet, {raw:false,dateNF:'22'});
|
||||
var ktp_data = XLSX.utils.sheet_to_json(worksheet, {cellText:true});
|
||||
var error = []
|
||||
// console.log("ktp_data", ktp_data)
|
||||
date_data.forEach(function(entry,iidx) {
|
||||
if(iidx > 0){
|
||||
//entry.TANGGAL_LAHIR = moment(entry.TANGGAL_LAHIR).format('DD-MM-YYYY')
|
||||
// console.log("DD", moment(entry.TANGGAL_LAHIR, 'DD-MM-YYYY').format('DD'));
|
||||
|
||||
// const date = new Date(entry.TANGGAL_LAHIR);
|
||||
// console.log("date",date)
|
||||
var day = moment(entry.TANGGAL_LAHIR, 'DD-MM-YYYY').format('DD');
|
||||
var month = moment(entry.TANGGAL_LAHIR, 'DD-MM-YYYY').format('MM');
|
||||
var year = moment(entry.TANGGAL_LAHIR, 'DD-MM-YYYY').format('YYYY');
|
||||
entry.KTP = ktp_data[iidx].KTP
|
||||
|
||||
// tanggal MCU
|
||||
if (entry.TANGGAL_MCU) {
|
||||
entry.TANGGAL_MCU = moment(entry.TANGGAL_MCU, 'DD-MM-YYYY');
|
||||
}
|
||||
|
||||
if (vm.cekKTP(entry.KTP, day, month, year)) {
|
||||
data_json.push(entry)
|
||||
} else {
|
||||
error.push(entry)
|
||||
}
|
||||
}
|
||||
})
|
||||
var prm = {
|
||||
xid:vm.selected_mgmmcu.Mgm_McuID,
|
||||
corporateID:vm.selected_mgmmcu.Mgm_McuCorporateID,
|
||||
data:data_json}
|
||||
// console.log("data json",data_json)
|
||||
// console.log("data prm",prm)
|
||||
//XLSX.utils.sheet_to_json(ws, {dateNF:"YYYY-MM-DD"})
|
||||
if (error.length != 0) {
|
||||
// console.log("error", error)
|
||||
vm.$store.commit("patient/update_error_identifier", error)
|
||||
vm.dialog_identifier = true
|
||||
} else {
|
||||
// console.log("prm",prm)
|
||||
vm.$store.dispatch("patient/savecsv", prm)
|
||||
}
|
||||
};
|
||||
reader.readAsArrayBuffer(f);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
opendialoginfo: {
|
||||
get() {
|
||||
return this.$store.state.patient.open_dialog_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_open_dialog_info",false)
|
||||
}
|
||||
},
|
||||
msginfo: {
|
||||
get() {
|
||||
return this.$store.state.patient.msg_info
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_msg_info",false)
|
||||
}
|
||||
},
|
||||
xidentifer() {
|
||||
return this.$store.state.patient.error_identifier
|
||||
},
|
||||
xmgmmcu() {
|
||||
return this.$store.state.patient.mgmmcu
|
||||
},
|
||||
selected_mgmmcu: {
|
||||
get() {
|
||||
return this.$store.state.patient.selected_mgmmcu
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_selected_mgmmcu", val)
|
||||
}
|
||||
},
|
||||
setupcode: {
|
||||
get() {
|
||||
return this.$store.state.patient.setupcode
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_setupcode", val)
|
||||
}
|
||||
},
|
||||
xsetup() {
|
||||
return this.$store.state.patient.data_setup
|
||||
},
|
||||
dialogconfirmationdelete: {
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_confirmation_delete
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete", val)
|
||||
}
|
||||
},
|
||||
msgconfirmationdelete() {
|
||||
return this.$store.state.patient.msg_confirmation_delete
|
||||
},
|
||||
status: {
|
||||
get() {
|
||||
return this.$store.state.patient.status
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_status", val)
|
||||
this.$store.dispatch("patient/search", {
|
||||
status: val,
|
||||
current_page: this.curr_page,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
},
|
||||
dialogsuccess: {
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_success", val)
|
||||
}
|
||||
},
|
||||
msgsuccess() {
|
||||
return this.$store.state.patient.msg_success
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.patient.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.patient.search_status == 1
|
||||
},
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.patient.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_open_alert_confirmation", val)
|
||||
}
|
||||
},
|
||||
loading_save: {
|
||||
get() {
|
||||
return this.$store.state.patient.loading_save
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_loading_save", val)
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
filters: {
|
||||
capitalize: function (str) {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1)
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
files: [],
|
||||
dialog_identifier: false,
|
||||
channel_name: '',
|
||||
channel_fields: [],
|
||||
channel_entries: [],
|
||||
parse_header: [],
|
||||
parse_csv: [],
|
||||
sortOrders:{},
|
||||
sortKey: '',
|
||||
statuses:[{id:"N",name:"Belum di download"},{id:"Y",name:"Sudah di download"}],
|
||||
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
items: [],
|
||||
name: '',
|
||||
snorm: '',
|
||||
page: 1,
|
||||
headers: [
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "50%",
|
||||
class: "pa-2 deep-orange accent-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "KTP",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "50%",
|
||||
class: "pa-2 deep-orange accent-1 white--text"
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'M_PatientName',
|
||||
totalItems: this.$store.state.patient.total_patients
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
3
test/vuex/cpone-mcu-offline-preregister-v3/csv-mcu.csv
Normal file
3
test/vuex/cpone-mcu-offline-preregister-v3/csv-mcu.csv
Normal file
@@ -0,0 +1,3 @@
|
||||
PID,NAMA,TANGGAL_LAHIR,JENIS_KELAMIN,NIK,JABATAN,EMAIL,HP,LOKASI,JOB,KEDUDUKAN
|
||||
,AA,12-09-2001,P,,GURU,,,,,
|
||||
,BB,14-01-1994,L,12.14.44.55,DIRKEU,,,,,
|
||||
|
BIN
test/vuex/cpone-mcu-offline-preregister-v3/csv-mcu.xls
Normal file
BIN
test/vuex/cpone-mcu-offline-preregister-v3/csv-mcu.xls
Normal file
Binary file not shown.
BIN
test/vuex/cpone-mcu-offline-preregister-v3/csv-mcu.xlsx
Normal file
BIN
test/vuex/cpone-mcu-offline-preregister-v3/csv-mcu.xlsx
Normal file
Binary file not shown.
118
test/vuex/cpone-mcu-offline-preregister-v3/index.php
Normal file
118
test/vuex/cpone-mcu-offline-preregister-v3/index.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<!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/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-content style="background:#F5E8DF!important" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs3 class="left" fill-height pa-1>
|
||||
<one-md-patient-list></one-md-patient-list>
|
||||
</v-flex>
|
||||
<v-flex xs9 class="right" fill-height pa-1>
|
||||
<one-md-patient-detail></one-md-patient-detail>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<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/vendor/sheetjs-master/xlsx.full.min.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;
|
||||
var ts = "?ts=" + Date.now();
|
||||
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
methods: {
|
||||
tab_selected : function(tab) {
|
||||
return this.$store.state.tab_selected == tab
|
||||
}
|
||||
},
|
||||
|
||||
mounted: function() {
|
||||
|
||||
|
||||
var url_string = window.location.href
|
||||
var url = new URL(url_string);
|
||||
var code = url.searchParams.get("code");
|
||||
|
||||
if (code != null) {
|
||||
this.$store.commit('order/update_setupcode', code)
|
||||
this.$store.commit("patient/update_patients", [])
|
||||
this.$store.commit("patient/update_total_patients", 0)
|
||||
this.$store.commit("patient/update_current_page", 1)
|
||||
this.$store.dispatch("patient/generatesetup", {
|
||||
setupcode : code
|
||||
})
|
||||
}
|
||||
if (!one_token())
|
||||
location.replace('/one-ui/test/vuex/one-login')
|
||||
},
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-md-patient-list': httpVueLoader('./components/oneMdPatientList.vue' + ts),
|
||||
'one-md-patient-detail': httpVueLoader('./components/oneMdPatientDetail.vue'),
|
||||
'one-md-patient-address': httpVueLoader('./components/oneMdPatientAddress.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
test/vuex/cpone-mcu-offline-preregister-v3/mcu_template.xlsx
Normal file
BIN
test/vuex/cpone-mcu-offline-preregister-v3/mcu_template.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
796
test/vuex/cpone-mcu-offline-preregister-v3/modules/patient.js
Normal file
796
test/vuex/cpone-mcu-offline-preregister-v3/modules/patient.js
Normal file
@@ -0,0 +1,796 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/patient.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
lookup_status: 0,
|
||||
mgmmcu: [],
|
||||
selected_mgmmcu: {},
|
||||
error_identifier: [],
|
||||
// cpone
|
||||
last_id: -1,
|
||||
last_saved_id: -1,
|
||||
x_addr_id: 0,
|
||||
act: 'edit',
|
||||
act_addr: 'new',
|
||||
get_data_status: 0,
|
||||
search_patient: 0,
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
norm: '',
|
||||
patient_prefix: '',
|
||||
patient_name: '',
|
||||
patient_suffix: '',
|
||||
titles: [],
|
||||
selected_title: {},
|
||||
dob: '',
|
||||
patients: [],
|
||||
total_patients: 0,
|
||||
patient_address: [],
|
||||
sexes: [],
|
||||
selected_sex: {},
|
||||
religions: [],
|
||||
selected_religion: {},
|
||||
phone: '',
|
||||
hp: '',
|
||||
email: '',
|
||||
pob: '',
|
||||
kartuidentitass: [],
|
||||
selected_kartuidentitas: {},
|
||||
noidentitas: '',
|
||||
note: '',
|
||||
nik: '',
|
||||
jabatan: '',
|
||||
kedudukan: '',
|
||||
pj: '',
|
||||
location: '',
|
||||
job: '',
|
||||
total_patient: 0,
|
||||
selected_patient: {},
|
||||
save_status: 0,
|
||||
btn_save_seen: true,
|
||||
pgrs_save: false,
|
||||
save_error_message: '',
|
||||
no_save: 0,
|
||||
open_alert_confirmation: false,
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
dialog_success: false,
|
||||
dialog_confirmation_delete: false,
|
||||
msg_confirmation_delete: "",
|
||||
dialog_confirmation_delete_addr: false,
|
||||
msg_confirmation_delete_addr: "",
|
||||
autocomplete_status: 0,
|
||||
dialog_form_address: false,
|
||||
label_address: '',
|
||||
addresses: [],
|
||||
cities: [],
|
||||
city_address: {},
|
||||
companies:[],
|
||||
company:{},
|
||||
mous:[],
|
||||
mou:{},
|
||||
doctors:[],
|
||||
doctor:{},
|
||||
districts: [],
|
||||
district_address: {},
|
||||
kelurahans: [],
|
||||
kelurahan_address: {},
|
||||
description_address: '',
|
||||
errors: [],
|
||||
current_page:1,
|
||||
autocomplete_status:0,
|
||||
status:{id:"N",name:"Belum di download"},
|
||||
start_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
end_date:moment(new Date()).format('YYYY-MM-DD'),
|
||||
selected_mous:[],
|
||||
selected_doctors:[],
|
||||
xid:-1,
|
||||
csv_json:[],
|
||||
data_setup:{},
|
||||
default_mu :{},
|
||||
default_doctor:{},
|
||||
setupcode:'',
|
||||
search:'',
|
||||
loading_save:false,
|
||||
open_dialog_info: false,
|
||||
msg_info: ''
|
||||
},
|
||||
mutations: {
|
||||
update_open_dialog_info(state, val) {
|
||||
state.open_dialog_info = val
|
||||
},
|
||||
update_msg_info(state, val) {
|
||||
state.msg_info = val
|
||||
},
|
||||
update_lookup_status(state, val) {
|
||||
state.lookup_status = val
|
||||
},
|
||||
update_mgmmcu(state, val) {
|
||||
state.mgmmcu = val
|
||||
},
|
||||
update_selected_mgmmcu(state, val) {
|
||||
state.selected_mgmmcu = val
|
||||
},
|
||||
update_error_identifier(state, val) {
|
||||
state.error_identifier = val
|
||||
},
|
||||
// cpone
|
||||
update_search(state,val){
|
||||
state.search = val
|
||||
},
|
||||
update_setupcode(state,val){
|
||||
state.setupcode = val
|
||||
},
|
||||
update_default_mu(state,val){
|
||||
state.default_mu = val
|
||||
},
|
||||
update_default_doctor(state,val){
|
||||
state.default_doctor = val
|
||||
},
|
||||
update_data_setup(state,val){
|
||||
state.data_setup = val
|
||||
},
|
||||
update_csv_json(state,val){
|
||||
state.csv_json = val
|
||||
},
|
||||
update_xid(state,val){
|
||||
state.xid = val
|
||||
},
|
||||
update_selected_doctors(state,val){
|
||||
state.selected_doctors = val
|
||||
},
|
||||
update_selected_mous(state,val){
|
||||
state.selected_mous = val
|
||||
},
|
||||
update_companies(state,val){
|
||||
state.companies = val
|
||||
},
|
||||
update_company(state,val){
|
||||
state.company = val
|
||||
},
|
||||
update_mous(state,val){
|
||||
state.mous = val
|
||||
},
|
||||
update_mou(state,val){
|
||||
state.mou = val
|
||||
},
|
||||
update_doctors(state,val){
|
||||
state.doctors = val
|
||||
},
|
||||
update_doctor(state,val){
|
||||
state.doctor = val
|
||||
},
|
||||
update_autocomplete_status(state,val){
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_start_date(state, val) {
|
||||
state.start_date = val
|
||||
},
|
||||
update_end_date(state, val) {
|
||||
state.end_date = val
|
||||
},
|
||||
update_status(state, val) {
|
||||
state.status = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_x_addr_id(state, val) {
|
||||
state.x_addr_id = val
|
||||
},
|
||||
update_last_id(state, val) {
|
||||
state.last_id = val
|
||||
},
|
||||
update_last_saved_id(state, val) {
|
||||
state.last_saved_id = val
|
||||
},
|
||||
update_act(state, val) {
|
||||
state.act = val
|
||||
},
|
||||
update_act_addr(state, val) {
|
||||
state.act_addr = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_search_error_message(state, patient) {
|
||||
state.search_error_message = patient
|
||||
},
|
||||
update_search_patient(state, patient) {
|
||||
state.search_patient = patient
|
||||
},
|
||||
update_dob(state, val) {
|
||||
state.dob = val
|
||||
},
|
||||
update_patient_prefix(state, val) {
|
||||
state.patient_prefix= val
|
||||
},
|
||||
update_patient_name(state, val) {
|
||||
state.patient_name = val
|
||||
},
|
||||
update_patient_suffix(state, val) {
|
||||
state.patient_suffix = val
|
||||
},
|
||||
update_norm(state, val) {
|
||||
state.norm = val
|
||||
},
|
||||
update_titles(state, val) {
|
||||
state.titles = val
|
||||
},
|
||||
update_selected_title(state, val) {
|
||||
state.selected_title = val
|
||||
},
|
||||
update_patients(state, data) {
|
||||
state.patients = data
|
||||
},
|
||||
update_selected_patient(state, val) {
|
||||
state.selected_patient = val
|
||||
},
|
||||
update_sexes(state, val) {
|
||||
state.sexes = val
|
||||
},
|
||||
update_selected_sex(state, val) {
|
||||
state.selected_sex = val
|
||||
},
|
||||
update_religions(state, val) {
|
||||
state.religions = val
|
||||
},
|
||||
update_selected_religion(state, val) {
|
||||
state.selected_religion = val
|
||||
},
|
||||
update_phone(state, val) {
|
||||
state.phone = val
|
||||
},
|
||||
update_email(state, val) {
|
||||
state.email = val
|
||||
},
|
||||
update_pob(state, val) {
|
||||
state.pob = val
|
||||
},
|
||||
update_hp(state, val) {
|
||||
state.hp = val
|
||||
},
|
||||
update_kartuidentitass(state, val) {
|
||||
state.kartuidentitass = val
|
||||
},
|
||||
update_selected_kartuidentitas(state, val) {
|
||||
state.selected_kartuidentitas = val
|
||||
},
|
||||
update_noidentitas(state, val) {
|
||||
state.noidentitas = val
|
||||
},
|
||||
update_note(state, val) {
|
||||
state.note = val
|
||||
},
|
||||
update_nik(state, val) {
|
||||
state.nik = val
|
||||
},
|
||||
update_jabatan(state, val) {
|
||||
state.jabatan = val
|
||||
},
|
||||
update_kedudukan(state, val) {
|
||||
state.kedudukan = val
|
||||
},
|
||||
update_pj(state, val) {
|
||||
state.pj = val
|
||||
},
|
||||
update_location(state, val) {
|
||||
state.location = val
|
||||
},
|
||||
update_job(state, val) {
|
||||
state.job = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_btn_save_seen(state, val) {
|
||||
state.btn_save_seen = val
|
||||
},
|
||||
update_pgrs_save(state, val) {
|
||||
state.pgrs_save = val
|
||||
},
|
||||
update_save_error_message(state, msg) {
|
||||
state.save_error_message = ''
|
||||
},
|
||||
update_no_save(state, val) {
|
||||
state.no_save = val
|
||||
},
|
||||
update_open_alert_confirmation(state, val) {
|
||||
state.open_alert_confirmation = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_dialog_success(state, val) {
|
||||
state.dialog_success = val
|
||||
},
|
||||
update_dialog_confirmation_delete(state, val) {
|
||||
state.dialog_confirmation_delete = val
|
||||
},
|
||||
update_msg_confirmation_delete(state, val) {
|
||||
state.msg_confirmation_delete = val
|
||||
},
|
||||
update_dialog_confirmation_delete_addr(state, val) {
|
||||
state.dialog_confirmation_delete_addr = val
|
||||
},
|
||||
update_msg_confirmation_delete_addr(state, val) {
|
||||
state.msg_confirmation_delete_addr = val
|
||||
},
|
||||
update_addresses(state, val) {
|
||||
state.addresses = val
|
||||
},
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_dialog_form_address(state, val) {
|
||||
state.dialog_form_address = val
|
||||
},
|
||||
update_label_address(state, val) {
|
||||
state.label_address = val
|
||||
},
|
||||
update_cities(state, val) {
|
||||
state.cities = val
|
||||
},
|
||||
update_city_address(state, val) {
|
||||
state.city_address = val
|
||||
},
|
||||
update_districts(state, val) {
|
||||
state.districts = val
|
||||
},
|
||||
update_district_address(state, val) {
|
||||
state.district_address = val
|
||||
},
|
||||
update_kelurahans(state, val) {
|
||||
state.kelurahans = val
|
||||
},
|
||||
update_kelurahan_address(state, val) {
|
||||
state.kelurahan_address = val
|
||||
},
|
||||
update_description_address(state, val) {
|
||||
state.description_address = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_total_patients(state, val) {
|
||||
state.total_patients = val
|
||||
},
|
||||
update_total_patient(state, val) {
|
||||
state.total_patient = val
|
||||
},
|
||||
update_loading_save(state, val) {
|
||||
state.loading_save = val
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async getmgmmcu(context) {
|
||||
context.commit("update_lookup_status", 1)
|
||||
try {
|
||||
var prm = {token: one_token()}
|
||||
let resp = await api.getmgmmcu(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_status", 3)
|
||||
} else {
|
||||
context.commit("update_lookup_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
}
|
||||
context.commit("update_mgmmcu", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_status", 3)
|
||||
}
|
||||
},
|
||||
// cpone
|
||||
|
||||
async generatesetup(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.generatesetup(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
console.log(resp.data.records)
|
||||
context.commit("update_data_setup", resp.data.records)
|
||||
context.commit("update_setupcode", '')
|
||||
context.commit("update_current_page", 1)
|
||||
//context.commit("update_patients", data.records['patients'])
|
||||
context.dispatch("search", {
|
||||
search:'',
|
||||
xid:context.state.data_setup.McuOfflinePrepareID,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_patient", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
prm.mgm_mcuid = context.state.selected_mgmmcu.Mgm_McuID
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_patient", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_patient", 2)
|
||||
context.commit("update_search_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_patients", data.records)
|
||||
context.commit("update_total_patient", data.total)
|
||||
context.commit("update_no_save", 0)
|
||||
|
||||
//context.commit("update_data_setup", resp.data.setup)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_patient", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async getsexreg(context) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getsexreg(one_token())
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_sexes", data.records.sexes)
|
||||
context.commit("update_religions", data.records.religions)
|
||||
context.commit("update_titles", data.records.titles)
|
||||
context.commit("update_kartuidentitass", data.records.kartuidentitass)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async savecsv(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
context.commit("update_loading_save", true)
|
||||
prm.token = one_token()
|
||||
let resp = await api.savecsv(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_open_dialog_info", true)
|
||||
context.commit("update_msg_info", resp.message)
|
||||
} else {
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_save_status", 2)
|
||||
//location.reload()
|
||||
context.dispatch("search", {
|
||||
search:'',
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async gotoreg(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.gotoreg(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
var pre_id = prm.Mcu_PreregisterDetailsID
|
||||
location.replace("/one-ui/test/vuex/one-fo-registration-v8/" + "?pre_id=" +pre_id)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async newpatient(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.newpatient(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
console.log(resp.data.id)
|
||||
context.commit("update_last_id", resp.data.id)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data pasien " + prm.M_PatientName + " sudah tersimpan dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.xdelete(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_last_id", 0)
|
||||
context.commit("update_dialog_confirmation_delete", false)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Data setup " + prm.code + " sudah dihapus dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_company", {})
|
||||
context.commit("update_selected_mous", [])
|
||||
context.commit("update_mou", {})
|
||||
context.commit("update_selected_doctors", [])
|
||||
context.commit("update_start_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_end_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_default_mou", {})
|
||||
context.commit("update_default_doctor", {})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async getaddress(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.getaddress(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_addresses", data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async savesetup(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.savesetup(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_company", {})
|
||||
context.commit("update_selected_mous", [])
|
||||
context.commit("update_mou", {})
|
||||
context.commit("update_selected_doctors", [])
|
||||
context.commit("update_start_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_end_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
context.commit("update_default_mou", {})
|
||||
context.commit("update_default_doctor", {})
|
||||
context.commit("update_dialog_success", true)
|
||||
if(context.state.act === 'new')
|
||||
var msg = "Pembuatan setup nomor " + resp.data.records.xnumber + " sudah berhasil dong ..."
|
||||
else
|
||||
var msg = "Perubahan setup nomor " + resp.data.records.xnumber + " sudah berhasil dong ..."
|
||||
|
||||
context.commit("update_msg_success", msg)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async searchcity(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
let resp = await api.searchcity(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_cities", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
},
|
||||
async searchdoctor(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
var xpar = {}
|
||||
xpar.search = prm
|
||||
xpar.token = one_token()
|
||||
let resp= await api.searchdoctor(xpar)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
var arr = resp.data.records
|
||||
var xsel = context.state.selected_doctors
|
||||
var filtered = arr.filter(o1 => xsel.filter(o2 => o2.id === o1.id).length === 0)
|
||||
context.commit("update_doctors",filtered)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
},
|
||||
async searchcompany(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
|
||||
let resp= await api.searchcompany(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_companies",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
},
|
||||
async getdistrict(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getdistrict(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_districts", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getkelurahan(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
let resp = await api.getkelurahan(one_token(), prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_kelurahans", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async savenewaddress(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.savenewaddress(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_form_address", false)
|
||||
context.commit("update_last_id", prm.M_PatientAddressM_PatientID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penambahan data alamat pasien " + prm.M_PatientName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async saveeditaddress(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.saveeditaddress(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_form_address", false)
|
||||
context.commit("update_last_id", prm.M_PatientAddressM_PatientID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Perubahan data alamat pasien " + prm.M_PatientName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async deleteaddress(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.deleteaddress(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_dialog_confirmation_delete_addr", false)
|
||||
context.commit("update_last_id", prm.M_PatientAddressM_PatientID)
|
||||
context.commit("update_dialog_success", true)
|
||||
var msg = "Penghapusan data alamat " + prm.M_PatientAddressNote + " dari pasien " + prm.M_PatientName + " sudah berhasil dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async getmou(context,prm) {
|
||||
context.commit("update_lookup_order",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getmou(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_order",3)
|
||||
} else {
|
||||
context.commit("update_lookup_order",2)
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_mous",resp.data.records)
|
||||
context.commit("update_mou",{})
|
||||
context.commit("update_selected_mous",[])
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_lookup_order",3)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
27
test/vuex/cpone-mcu-offline-preregister-v3/store.js
Normal file
27
test/vuex/cpone-mcu-offline-preregister-v3/store.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import patient from "./modules/patient.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
patient: patient,
|
||||
system: system
|
||||
},
|
||||
state: {
|
||||
tab_selected: 'pasien-dokter'
|
||||
},
|
||||
mutations: {
|
||||
change_tab(state, ntab) {
|
||||
state.tab_selected = ntab
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
change_tab(context, ntab) {
|
||||
context.commit('change_tab', ntab)
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -5,7 +5,7 @@
|
||||
<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>
|
||||
<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">
|
||||
@@ -165,4 +165,4 @@
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -5306,9 +5306,6 @@ module.exports = {
|
||||
if (entry.name === "Hemorroid") {
|
||||
let normal = 'Y'
|
||||
let count_x = _.filter(entry.details, function (o) {
|
||||
if(o.id_code == 'perut_18' || o.id_code == 'perut_17'){
|
||||
normal = 'N'
|
||||
}
|
||||
return o.chx;
|
||||
}).length;
|
||||
if (count_x === 0) {
|
||||
@@ -5318,6 +5315,12 @@ module.exports = {
|
||||
error_msg_fisik.push(x_msg);
|
||||
}
|
||||
|
||||
entry.details.forEach((detail) => {
|
||||
if(detail.chx && (detail.id_code == 'perut_18' || detail.id_code == 'perut_17')){
|
||||
normal = 'N'
|
||||
}
|
||||
})
|
||||
|
||||
entry.details.forEach((detail) => {
|
||||
if(normal == 'N'){
|
||||
if(detail.id_code == 'perut_15' || detail.id_code == 'perut_16'){
|
||||
@@ -5332,7 +5335,7 @@ module.exports = {
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (entry.name === "Pengukuran" || entry.name === "Measurement") {
|
||||
|
||||
@@ -2792,6 +2792,7 @@
|
||||
this.$store.commit("sample/update_fisiks", fisiks);
|
||||
},
|
||||
changeXVSChx(idx_f, idx_s, row) {
|
||||
console.log('[changeXVSChx]', { idx_f, idx_s, label: row.label, id_code: row.id_code, is_normal: row.is_normal, chx: row.chx })
|
||||
var fisiks = this.fisiks;
|
||||
var isnormal = row.is_normal;
|
||||
|
||||
@@ -3544,6 +3545,7 @@
|
||||
});
|
||||
|
||||
if (go_action) {
|
||||
console.log('[saveResult] fisiks saat save:', JSON.stringify(this.fisiks))
|
||||
this.$store.commit("sample/update_last_id", arr.re_id);
|
||||
this.$store.dispatch("sample/savefisik", {
|
||||
template: template,
|
||||
|
||||
@@ -458,20 +458,6 @@ module.exports = {
|
||||
this.$store.commit("sample/update_act", "new");
|
||||
},
|
||||
closeDialogSuccess() {
|
||||
let arrtrx = this.$store.state.sample.transactions;
|
||||
//var idx = _.findIndex(arrtrx, item => item.re_id === this.$store.state.sample.last_id)
|
||||
// console.log(idx)
|
||||
this.$store.dispatch("sample/search", {
|
||||
startdate: this.xdatestart,
|
||||
enddate: this.xdateend,
|
||||
search: this.xnamelab,
|
||||
companyid: this.selected_company.id,
|
||||
switch_exclude: this.switch_exclude,
|
||||
stationid: this.xselectedstation.id,
|
||||
groupid: this.$store.state.sample.select_item_group.id,
|
||||
subgroupid: this.$store.state.sample.select_item_subgroup.id,
|
||||
lastid: this.$store.state.sample.last_id,
|
||||
});
|
||||
this.$store.commit("sample/update_dialog_success", false);
|
||||
},
|
||||
closeDialogInfo() {
|
||||
|
||||
@@ -1086,23 +1086,23 @@ export default {
|
||||
context.commit("update_dialog_doctor", false)
|
||||
|
||||
if (context.state.search_lab_no === '') {
|
||||
//console.log("aye")
|
||||
var transactions = context.state.transactions
|
||||
//console.log(transactions)
|
||||
//var selected = context.state.selected_transaction
|
||||
//var idx = _.findIndex(transactions, item => item.re_id === selected.re_id)
|
||||
//console.log(idx)
|
||||
var search_prm = {
|
||||
startdate: context.state.start_date,
|
||||
enddate: context.state.end_date,
|
||||
search: context.state.name_lab,
|
||||
stationid: context.state.selected_station.id,
|
||||
groupid: context.state.select_item_group.id,
|
||||
subgroupid: context.state.select_item_subgroup.id,
|
||||
current_page: 1,
|
||||
lastid: context.state.last_id
|
||||
const sel = context.state.selected_detail
|
||||
const doc = prm.selected_doctor
|
||||
let transactions = [...context.state.transactions]
|
||||
let trx_idx = _.findIndex(transactions, t => t.re_id == sel.re_id)
|
||||
if (trx_idx !== -1) {
|
||||
let trx = { ...transactions[trx_idx] }
|
||||
if (trx.details) {
|
||||
trx.details = trx.details.map(d =>
|
||||
d.re_id == sel.re_id
|
||||
? { ...d, doctor_fullname: doc.name, doctor_id: doc.id }
|
||||
: d
|
||||
)
|
||||
}
|
||||
transactions[trx_idx] = trx
|
||||
context.commit("update_transactions", transactions)
|
||||
context.commit("update_selected_transaction", trx)
|
||||
}
|
||||
context.dispatch("search", search_prm)
|
||||
} else {
|
||||
location.reload()
|
||||
}
|
||||
@@ -1296,6 +1296,23 @@ export default {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
_applyStatusUpdate(context, rec) {
|
||||
const statusMap = { NEW: 'BARU', VAL1: 'VALIDASI', VAL2: 'VERIFIKASI' }
|
||||
const status_name = statusMap[rec.So_ResultEntryStatus] || 'NO TEMPLATE'
|
||||
const status = rec.So_ResultEntryStatus
|
||||
let transactions = [...context.state.transactions]
|
||||
let idx = _.findIndex(transactions, t => t.re_id == rec.So_ResultEntryID)
|
||||
if (idx !== -1) {
|
||||
let trx = { ...transactions[idx], status_name, status }
|
||||
if (trx.details && trx.details.length > 0) {
|
||||
trx.details = trx.details.map(d => ({ ...d, status, status_name }))
|
||||
}
|
||||
transactions[idx] = trx
|
||||
context.commit("update_transactions", transactions)
|
||||
context.commit("update_selected_transaction", trx)
|
||||
}
|
||||
context.commit("update_cantedit", status_name !== 'BARU')
|
||||
},
|
||||
async saveresult(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
@@ -1311,6 +1328,8 @@ export default {
|
||||
context.commit("update_dialog_action", false)
|
||||
var msg = "Order " + prm.trx_numbering + " pemeriksaan <span class='red--text'>" + prm.trx.test_name + "</span> berhasil diupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
if (resp.data && resp.data.records && resp.data.records.So_ResultEntryID)
|
||||
context.dispatch("_applyStatusUpdate", resp.data.records)
|
||||
context.commit("update_dialog_success", true)
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -1357,6 +1376,8 @@ export default {
|
||||
context.commit("update_dialog_action", false)
|
||||
var msg = "Order " + prm.trx_numbering + " pemeriksaan <span class='red--text'>" + prm.trx.test_name + "</span> berhasil diupdate dong ..."
|
||||
context.commit("update_msg_success", msg)
|
||||
if (resp.data && resp.data.records && resp.data.records.So_ResultEntryID)
|
||||
context.dispatch("_applyStatusUpdate", resp.data.records)
|
||||
context.commit("update_dialog_success", true)
|
||||
if (context.state.search_lab_no !== '') {
|
||||
console.log(context.state.next_url)
|
||||
|
||||
@@ -2904,16 +2904,15 @@ value_perut_14, idx_perut_14
|
||||
</v-dialog>
|
||||
<template>
|
||||
<v-dialog v-model="openprint" style="overflow: hidden !important;" fullscreen>
|
||||
<v-card>
|
||||
<v-card-text>
|
||||
<object type="application/pdf" style="overflow: hidden; min-height: 100vh; width: 100%;"
|
||||
:data="urlprint"></object>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-card style="display: flex; flex-direction: column; height: 100vh;">
|
||||
<v-card-actions style="flex-shrink: 0;">
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn color="green darken-1" flat="flat" @click="closePrint">Tutup</v-btn>
|
||||
</v-card-actions>
|
||||
<v-card-text style="flex: 1; padding: 0; overflow: hidden;">
|
||||
<object type="application/pdf" style="width: 100%; height: 100%; display: block;"
|
||||
:data="urlprint"></object>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
@@ -22,7 +22,7 @@ const URL = "/one-api/cpone/mcuoffline/";
|
||||
|
||||
|
||||
|
||||
export async function getmultitemplates(prm) {
|
||||
export async function getmultitemplates(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'setupmcu/setupmcucponev7/getmultitemplates', prm);
|
||||
if (resp.status != 200) {
|
||||
@@ -39,10 +39,29 @@ export async function getmultitemplates(prm) {
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function getCover(prm) {
|
||||
}
|
||||
|
||||
export async function getReportUrlTemplates(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'setupmcu/setupmcucponev7/get_report_template_mcu', prm);
|
||||
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 getCover(prm) {
|
||||
try {
|
||||
console.log('dadasda cover api')
|
||||
var resp = await axios.post(URL + 'setupmcu/setupmcucponev7/getcover', prm);
|
||||
@@ -676,4 +695,4 @@ export async function getdeliveries(prm) {
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,8 +391,8 @@
|
||||
<!-- template fisik -->
|
||||
|
||||
<!-- Report hasil -->
|
||||
<v-flex xs12 pa-2>
|
||||
<v-radio-group hide-details v-model="reportresult">
|
||||
<v-flex xs12 pa-2>
|
||||
<v-radio-group hide-details v-model="reportresult">
|
||||
<template v-slot:label>
|
||||
<h4 class="subheader pl-2 pt-2 pb-2">REPORT HASIL</h4>
|
||||
</template>
|
||||
@@ -419,9 +419,14 @@
|
||||
</v-radio>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-radio-group>
|
||||
</v-flex>
|
||||
<!-- cover -->
|
||||
</v-radio-group>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-autocomplete :items="xreportUrlTemplates" v-model="selected_reportUrlTemplate" item-text="reportName"
|
||||
hide-details outline item-value="id" return-object label="Report URL Template">
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<!-- cover -->
|
||||
<v-flex xs12 pa-2>
|
||||
<v-autocomplete :items="covers" v-model="selected_cover" item-text="name" hide-details
|
||||
outline item-value="code" return-object label="Cover">
|
||||
@@ -651,10 +656,11 @@ module.exports = {
|
||||
components: {
|
||||
"one-dialog-print": httpVueLoader("../../common/oneDialogPrintX.vue"),
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("patient/getTemplateFisikMapping");
|
||||
this.$store.dispatch("patient/getBranch");
|
||||
this.$store.dispatch("patient/getTPriceHeaderCurrent");
|
||||
mounted() {
|
||||
this.$store.dispatch("patient/getTemplateFisikMapping");
|
||||
this.$store.dispatch("patient/getReportUrlTemplates", { Mgm_McuID: 0 });
|
||||
this.$store.dispatch("patient/getBranch");
|
||||
this.$store.dispatch("patient/getTPriceHeaderCurrent");
|
||||
// this.$store.dispatch("patient/getPackets", {
|
||||
// searchPacket : this.search_packet,
|
||||
// current_page: this.current_page_packet,
|
||||
@@ -738,12 +744,23 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
// cpone
|
||||
xgeneratepasswordby() {
|
||||
return this.$store.state.patient.generatepasswordby
|
||||
},
|
||||
selected_generatepasswordby: {
|
||||
get() {
|
||||
return this.$store.state.patient.selected_generatepasswordby
|
||||
xgeneratepasswordby() {
|
||||
return this.$store.state.patient.generatepasswordby
|
||||
},
|
||||
xreportUrlTemplates() {
|
||||
return this.$store.state.patient.reportUrlTemplates
|
||||
},
|
||||
selected_reportUrlTemplate: {
|
||||
get() {
|
||||
return this.$store.state.patient.selected_reportUrlTemplate
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_selected_reportUrlTemplate", val || {})
|
||||
}
|
||||
},
|
||||
selected_generatepasswordby: {
|
||||
get() {
|
||||
return this.$store.state.patient.selected_generatepasswordby
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_selected_generatepasswordby", val)
|
||||
@@ -1458,10 +1475,11 @@ module.exports = {
|
||||
// }
|
||||
// this.$store.dispatch("patient/savesetup",prm)
|
||||
|
||||
var prm = {
|
||||
Mgm_McuGeneratePasswordBY: this.selected_generatepasswordby.generatepasswordbycode,
|
||||
Mgm_McuReportHasil: this.reportresult,
|
||||
arrUserMcu: this.xUserMculists,
|
||||
var prm = {
|
||||
Mgm_McuGeneratePasswordBY: this.selected_generatepasswordby.generatepasswordbycode,
|
||||
Mcu_ReportUrlTemplateID: this.selected_reportUrlTemplate && this.selected_reportUrlTemplate.id ? this.selected_reportUrlTemplate.id : 0,
|
||||
Mgm_McuReportHasil: this.reportresult,
|
||||
arrUserMcu: this.xUserMculists,
|
||||
deleted_usermcus: this.$store.state.patient.deleted_usermcus,
|
||||
xid: this.$store.state.patient.xid,
|
||||
act: this.$store.state.patient.act,
|
||||
|
||||
@@ -236,9 +236,12 @@ module.exports = {
|
||||
Mgm_McuID: row.Mgm_McuID
|
||||
})
|
||||
|
||||
this.$store.dispatch("patient/getBg", {
|
||||
Mgm_McuID: row.Mgm_McuID
|
||||
})
|
||||
this.$store.dispatch("patient/getBg", {
|
||||
Mgm_McuID: row.Mgm_McuID
|
||||
})
|
||||
this.$store.dispatch("patient/getReportUrlTemplates", {
|
||||
Mgm_McuID: row.Mgm_McuID
|
||||
})
|
||||
|
||||
this.$store.commit("patient/update_inp_Mgm_McuNote", row.Mgm_McuNote)
|
||||
|
||||
@@ -259,10 +262,14 @@ module.exports = {
|
||||
this.$store.dispatch("patient/getusermcu", {
|
||||
Mgm_McuID: this.$store.state.patient.selected_patient.Mgm_McuID
|
||||
})
|
||||
this.$store.commit("patient/update_reportresult", row.Mgm_McuReportHasil)
|
||||
this.$store.commit("patient/update_selected_generatepasswordby", {
|
||||
generatepasswordbycode: row.generatepasswordbycode,
|
||||
generatepasswordbyname: row.generatepasswordbyname
|
||||
this.$store.commit("patient/update_reportresult", row.Mgm_McuReportHasil)
|
||||
this.$store.commit("patient/update_selected_reportUrlTemplate", {
|
||||
id: row.Mcu_ReportUrlTemplateID || 0,
|
||||
reportName: row.Mcu_ReportUrlTemplateName || ""
|
||||
})
|
||||
this.$store.commit("patient/update_selected_generatepasswordby", {
|
||||
generatepasswordbycode: row.generatepasswordbycode,
|
||||
generatepasswordbyname: row.generatepasswordbyname
|
||||
})
|
||||
|
||||
// this.$store.commit("patient/update_companies", [{id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName}])
|
||||
@@ -325,10 +332,12 @@ module.exports = {
|
||||
this.$store.commit("patient/update_inp_Mgm_McuUserEmail", "")
|
||||
this.$store.commit("patient/update_selected_branch", {})
|
||||
this.$store.commit("patient/update_selected_tpriceheaderformCb", {})
|
||||
this.$store.commit("patient/update_userMcuLists", [])
|
||||
this.$store.commit("patient/update_reportresult", "1")
|
||||
this.$store.commit("patient/update_selected_generatepasswordby", {})
|
||||
},
|
||||
this.$store.commit("patient/update_userMcuLists", [])
|
||||
this.$store.commit("patient/update_reportresult", "1")
|
||||
this.$store.commit("patient/update_selected_generatepasswordby", {})
|
||||
this.$store.commit("patient/update_selected_reportUrlTemplate", {})
|
||||
this.$store.dispatch("patient/getReportUrlTemplates", { Mgm_McuID: 0 })
|
||||
},
|
||||
searchMgmMcu() {
|
||||
// var prm = this.default_mou
|
||||
// prm.search = this.search_mgmmcu
|
||||
@@ -652,4 +661,4 @@ module.exports = {
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -157,20 +157,28 @@ export default {
|
||||
selected_cover: {code: 'DFLT', name: 'Cover Default'},
|
||||
backgrounds: [],
|
||||
selected_bg: {code: 'DFLT', name: 'Background Default', image: 'one-ui/BackgroundWesterindo.png'},
|
||||
multitemplates: [],
|
||||
selected_multitemplates: {},
|
||||
// cpone
|
||||
},
|
||||
mutations: {
|
||||
multitemplates: [],
|
||||
selected_multitemplates: {},
|
||||
reportUrlTemplates: [],
|
||||
selected_reportUrlTemplate: {},
|
||||
// cpone
|
||||
},
|
||||
mutations: {
|
||||
update_multitemplates(state, val) {
|
||||
state.multitemplates = val
|
||||
},
|
||||
update_selected_multitemplates(state, val) {
|
||||
state.selected_multitemplates = val
|
||||
},
|
||||
update_covers(state, val) {
|
||||
state.covers = val
|
||||
},
|
||||
update_selected_multitemplates(state, val) {
|
||||
state.selected_multitemplates = val
|
||||
},
|
||||
update_reportUrlTemplates(state, val) {
|
||||
state.reportUrlTemplates = val
|
||||
},
|
||||
update_selected_reportUrlTemplate(state, val) {
|
||||
state.selected_reportUrlTemplate = val
|
||||
},
|
||||
update_covers(state, val) {
|
||||
state.covers = val
|
||||
},
|
||||
update_backgrounds(state, val) {
|
||||
state.backgrounds = val
|
||||
},
|
||||
@@ -850,7 +858,7 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
async getTemplateFisikMapping(context) {
|
||||
async getTemplateFisikMapping(context) {
|
||||
context.commit("update_search_patient", 1)
|
||||
try {
|
||||
var prm = { token: one_token() }
|
||||
@@ -867,7 +875,27 @@ export default {
|
||||
} catch (e) {
|
||||
context.commit("update_search_patient", 3)
|
||||
}
|
||||
},
|
||||
},
|
||||
async getReportUrlTemplates(context, prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
var xprm = prm || {}
|
||||
xprm.token = one_token()
|
||||
let resp = await api.getReportUrlTemplates(xprm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_get_data_status", 3)
|
||||
} else {
|
||||
context.commit("update_get_data_status", 2)
|
||||
const rows = resp.data.records || []
|
||||
context.commit("update_reportUrlTemplates", rows)
|
||||
if (resp.data.selected) {
|
||||
context.commit("update_selected_reportUrlTemplate", resp.data.selected)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
|
||||
async searchv0(context, prm) {
|
||||
context.commit("update_search_patient", 1)
|
||||
@@ -964,9 +992,10 @@ export default {
|
||||
context.commit("update_userMcuLists", [])
|
||||
context.commit("update_inp_Mgm_McuUserEmail", "")
|
||||
context.commit("update_inp_Mgm_McuUserPassword", "")
|
||||
context.commit("update_reportresult", "1")
|
||||
context.commit("update_selected_generatepasswordby", {})
|
||||
context.commit("update_inp_Mgm_McuLowBackPainTampilSemua", false)
|
||||
context.commit("update_reportresult", "1")
|
||||
context.commit("update_selected_generatepasswordby", {})
|
||||
context.commit("update_selected_reportUrlTemplate", {})
|
||||
context.commit("update_inp_Mgm_McuLowBackPainTampilSemua", false)
|
||||
// context.commit("update_total_patient_test", 0)
|
||||
|
||||
if (context.state.act === 'new')
|
||||
@@ -1009,9 +1038,10 @@ export default {
|
||||
context.commit("update_inp_Mgm_McuTotalParticipant", 0)
|
||||
context.commit("update_inp_Mgm_McuPicName", "")
|
||||
context.commit("update_inp_Mgm_McuPicEmail", "")
|
||||
context.commit("update_reportresult", "1")
|
||||
context.commit("update_selected_generatepasswordby", {})
|
||||
// context.commit("update_current_page_packet", 1)
|
||||
context.commit("update_reportresult", "1")
|
||||
context.commit("update_selected_generatepasswordby", {})
|
||||
context.commit("update_selected_reportUrlTemplate", {})
|
||||
// context.commit("update_current_page_packet", 1)
|
||||
// context.commit("update_total_patient_packet", 0)
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -1450,4 +1480,4 @@ export default {
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
47
test/vuex/dashboard-user-mcu/api/dashboard_user.js
Normal file
47
test/vuex/dashboard-user-mcu/api/dashboard_user.js
Normal file
@@ -0,0 +1,47 @@
|
||||
const URL = (window.BASE_URL ? window.BASE_URL : "") + "/one-api/dashboard_mcu/user/";
|
||||
|
||||
async function post(endpoint, prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + endpoint, prm)
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
}
|
||||
}
|
||||
return resp.data
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function save(prm) {
|
||||
return post('save', prm)
|
||||
}
|
||||
|
||||
export async function reset_password(prm) {
|
||||
return post('reset_password', prm)
|
||||
}
|
||||
|
||||
export async function remove_user(prm) {
|
||||
return post('remove_user', prm)
|
||||
}
|
||||
|
||||
export async function assign_project(prm) {
|
||||
return post('assign_project', prm)
|
||||
}
|
||||
|
||||
export async function remove_project(prm) {
|
||||
return post('remove_project', prm)
|
||||
}
|
||||
|
||||
export async function search_project(prm) {
|
||||
return post('search_project', prm)
|
||||
}
|
||||
|
||||
export async function search(prm) {
|
||||
return post('search', prm)
|
||||
}
|
||||
@@ -0,0 +1,300 @@
|
||||
<template>
|
||||
<v-layout class="mb-2" column>
|
||||
<v-dialog v-model="dialogsuccess" persistent max-width="320">
|
||||
<v-card>
|
||||
<v-card-title class="headline success white--text">Berhasil</v-card-title>
|
||||
<v-card-text>{{ msgsuccess }}</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" flat @click="closeDialogSuccess">OK</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-card>
|
||||
<v-subheader red--text text--lighten-1>
|
||||
DASHBOARD USER MCU
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small color="warning" @click="newForm">Baru</v-btn>
|
||||
<v-btn small color="primary" @click="saveUser">Simpan</v-btn>
|
||||
<v-btn small color="info" @click="resetPassword">Reset Password</v-btn>
|
||||
<v-btn small color="error" :disabled="!isEditMode" @click="removeUser">Hapus User</v-btn>
|
||||
</v-subheader>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-layout row wrap class="pa-2">
|
||||
<v-flex xs12 pa-1>
|
||||
<v-text-field label="Username*" :readonly="isEditMode" v-model="username"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-text-field label="Display Name" v-model="displayName"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1 v-if="!isEditMode">
|
||||
<v-text-field
|
||||
label="Password*"
|
||||
type="password"
|
||||
hint="Minimal 8 karakter, wajib huruf besar, huruf kecil, angka, dan simbol"
|
||||
persistent-hint
|
||||
:success="passwordReady"
|
||||
:error="passwordTouched && !passwordReady"
|
||||
:error-messages="passwordTouched && !passwordReady ? ['Password belum memenuhi aturan'] : []"
|
||||
@blur="passwordTouched = true"
|
||||
v-model="password"
|
||||
></v-text-field>
|
||||
<div class="caption mt-1">
|
||||
<span :class="passwordChecks.length ? 'green--text' : 'red--text'">• Minimal 8 karakter</span><br>
|
||||
<span :class="passwordChecks.upper ? 'green--text' : 'red--text'">• Ada huruf besar (A-Z)</span><br>
|
||||
<span :class="passwordChecks.lower ? 'green--text' : 'red--text'">• Ada huruf kecil (a-z)</span><br>
|
||||
<span :class="passwordChecks.number ? 'green--text' : 'red--text'">• Ada angka (0-9)</span><br>
|
||||
<span :class="passwordChecks.symbol ? 'green--text' : 'red--text'">• Ada simbol</span>
|
||||
</div>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete
|
||||
v-model="selectedProject"
|
||||
:items="projectItems"
|
||||
:search-input.sync="projectKeyword"
|
||||
item-text="label"
|
||||
return-object
|
||||
label="Cari Project (Nomor / Nama)"
|
||||
no-filter
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-btn small color="primary" @click="assignProject">Assign Project</v-btn>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 pa-1>
|
||||
<div class="caption mb-1">Project Assigned</div>
|
||||
<v-chip
|
||||
v-for="(p, idx) in assignedProjects"
|
||||
:key="idx"
|
||||
class="mr-1 mb-1"
|
||||
close
|
||||
@input="removeProject(p)"
|
||||
>
|
||||
{{ p.project_number }} - {{ p.project_name }}
|
||||
</v-chip>
|
||||
<div v-if="assignedProjects.length == 0" class="grey--text caption">Belum ada project</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
username: '',
|
||||
displayName: '',
|
||||
password: '',
|
||||
passwordTouched: false,
|
||||
selectedProject: null,
|
||||
projectKeyword: '',
|
||||
pendingProjects: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selectedUser() { return this.$store.state.dashboard_user.selected_user || {} },
|
||||
isEditMode() { return !!(this.selectedUser && this.selectedUser.User_ID) },
|
||||
assignedProjects() { return this.isEditMode ? (this.selectedUser.projects || []) : this.pendingProjects },
|
||||
dialogsuccess() { return this.$store.state.dashboard_user.dialog_success },
|
||||
msgsuccess() { return this.$store.state.dashboard_user.msg_success },
|
||||
passwordChecks() {
|
||||
let pwd = this.password || ''
|
||||
return {
|
||||
length: pwd.length >= 8,
|
||||
upper: /[A-Z]/.test(pwd),
|
||||
lower: /[a-z]/.test(pwd),
|
||||
number: /[0-9]/.test(pwd),
|
||||
symbol: /[^A-Za-z0-9]/.test(pwd)
|
||||
}
|
||||
},
|
||||
passwordReady() {
|
||||
return this.passwordChecks.length
|
||||
&& this.passwordChecks.upper
|
||||
&& this.passwordChecks.lower
|
||||
&& this.passwordChecks.number
|
||||
&& this.passwordChecks.symbol
|
||||
},
|
||||
projectItems() {
|
||||
return (this.$store.state.dashboard_user.project_options || []).map(p => {
|
||||
return Object.assign({}, p, { label: p.project_number + ' - ' + p.project_name })
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
selectedUser: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
this.username = val.User_Username || ''
|
||||
this.displayName = val.User_DisplayName || ''
|
||||
this.password = ''
|
||||
this.passwordTouched = false
|
||||
if (val && val.User_ID) this.pendingProjects = []
|
||||
}
|
||||
},
|
||||
projectKeyword(val, old) {
|
||||
let next = (val || '').trim()
|
||||
let prev = (old || '').trim()
|
||||
if (next === prev) return
|
||||
this.thrSearchProject(next)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
thrSearchProject: _.debounce(function(keyword) {
|
||||
this.$store.dispatch('dashboard_user/search_project', { search: keyword || '' })
|
||||
}, 300),
|
||||
closeDialogSuccess() {
|
||||
this.$store.commit('dashboard_user/update_dialog_success', false)
|
||||
this.refreshList()
|
||||
},
|
||||
refreshList() {
|
||||
this.$store.dispatch('dashboard_user/search', {
|
||||
username: this.$store.state.dashboard_user.search_username || '',
|
||||
project: this.$store.state.dashboard_user.search_project && this.$store.state.dashboard_user.search_project.mcu_id ? this.$store.state.dashboard_user.search_project.mcu_id : 'all',
|
||||
page: this.$store.state.dashboard_user.page || 1,
|
||||
limit: this.$store.state.dashboard_user.limit || 20
|
||||
})
|
||||
},
|
||||
validateBasic(requirePassword) {
|
||||
if (!this.username) {
|
||||
alert('Username wajib diisi')
|
||||
return false
|
||||
}
|
||||
if (requirePassword && !this.password) {
|
||||
alert('Password wajib diisi')
|
||||
return false
|
||||
}
|
||||
if (requirePassword) {
|
||||
this.passwordTouched = true
|
||||
let pwd = this.password || ''
|
||||
if (pwd.length < 8) {
|
||||
alert('Password minimal 8 karakter')
|
||||
return false
|
||||
}
|
||||
if (!(/[A-Z]/.test(pwd) && /[a-z]/.test(pwd) && /[0-9]/.test(pwd) && /[^A-Za-z0-9]/.test(pwd))) {
|
||||
alert('Password harus mengandung huruf besar, huruf kecil, angka, dan simbol')
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
},
|
||||
async saveUser() {
|
||||
if (!this.validateBasic(!this.isEditMode)) return
|
||||
let resp = await this.$store.dispatch('dashboard_user/save', {
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
display_name: this.displayName
|
||||
})
|
||||
if (resp.status == 'OK') {
|
||||
if (this.pendingProjects.length > 0) {
|
||||
for (let i = 0; i < this.pendingProjects.length; i++) {
|
||||
let p = this.pendingProjects[i]
|
||||
await this.$store.dispatch('dashboard_user/assign_project', {
|
||||
username: this.username,
|
||||
mcu_id: p.mcu_id
|
||||
})
|
||||
}
|
||||
this.pendingProjects = []
|
||||
}
|
||||
this.passwordTouched = false
|
||||
this.$store.commit('dashboard_user/update_selected_user', {})
|
||||
this.refreshList()
|
||||
} else {
|
||||
alert(resp.message || 'Gagal simpan user')
|
||||
}
|
||||
},
|
||||
async resetPassword() {
|
||||
this.password = window.prompt('Masukkan password baru') || ''
|
||||
if (!this.validateBasic(true)) return
|
||||
let resp = await this.$store.dispatch('dashboard_user/reset_password', {
|
||||
username: this.username,
|
||||
password: this.password
|
||||
})
|
||||
if (resp.status != 'OK') {
|
||||
alert(resp.message || 'Gagal reset password')
|
||||
}
|
||||
},
|
||||
async removeUser() {
|
||||
if (!this.isEditMode || !this.username) {
|
||||
alert('Pilih user dulu')
|
||||
return
|
||||
}
|
||||
if (!window.confirm('Hapus user ini?')) return
|
||||
let resp = await this.$store.dispatch('dashboard_user/remove_user', {
|
||||
username: this.username
|
||||
})
|
||||
if (resp.status == 'OK') {
|
||||
this.newForm()
|
||||
this.refreshList()
|
||||
} else {
|
||||
alert(resp.message || 'Gagal hapus user')
|
||||
}
|
||||
},
|
||||
async assignProject() {
|
||||
if (!this.username) {
|
||||
alert('Pilih atau isi username dulu')
|
||||
return
|
||||
}
|
||||
if (!this.selectedProject || !this.selectedProject.mcu_id) {
|
||||
alert('Pilih project dulu')
|
||||
return
|
||||
}
|
||||
if (!this.isEditMode) {
|
||||
let exists = this.pendingProjects.find(p => p.mcu_id == this.selectedProject.mcu_id)
|
||||
if (exists) {
|
||||
this.selectedProject = null
|
||||
this.projectKeyword = ''
|
||||
return
|
||||
}
|
||||
this.pendingProjects.push(this.selectedProject)
|
||||
this.selectedProject = null
|
||||
this.projectKeyword = ''
|
||||
return
|
||||
}
|
||||
let resp = await this.$store.dispatch('dashboard_user/assign_project', {
|
||||
username: this.username,
|
||||
mcu_id: this.selectedProject.mcu_id
|
||||
})
|
||||
if (resp.status == 'OK') {
|
||||
this.selectedProject = null
|
||||
this.projectKeyword = ''
|
||||
this.refreshList()
|
||||
} else {
|
||||
alert(resp.message || 'Gagal assign project')
|
||||
}
|
||||
},
|
||||
async removeProject(project) {
|
||||
if (!project || !project.mcu_id) return
|
||||
if (!this.isEditMode) {
|
||||
this.pendingProjects = this.pendingProjects.filter(p => p.mcu_id != project.mcu_id)
|
||||
return
|
||||
}
|
||||
if (!this.username) return
|
||||
let resp = await this.$store.dispatch('dashboard_user/remove_project', {
|
||||
username: this.username,
|
||||
mcu_id: project.mcu_id
|
||||
})
|
||||
if (resp.status == 'OK') {
|
||||
this.refreshList()
|
||||
} else {
|
||||
alert(resp.message || 'Gagal remove project')
|
||||
}
|
||||
},
|
||||
newForm() {
|
||||
this.$store.commit('dashboard_user/update_selected_user', {})
|
||||
this.username = ''
|
||||
this.displayName = ''
|
||||
this.password = ''
|
||||
this.passwordTouched = false
|
||||
this.selectedProject = null
|
||||
this.projectKeyword = ''
|
||||
this.pendingProjects = []
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs5 pa-1>
|
||||
<v-text-field
|
||||
label="search"
|
||||
placeholder="ketikkan username"
|
||||
browser-autocomplete="new-password"
|
||||
name="q_search_user_mcu"
|
||||
readonly
|
||||
outline
|
||||
hide-details
|
||||
@focus="$event.target.removeAttribute('readonly')"
|
||||
@keyup.enter="doSearch(1)"
|
||||
v-model="username"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs5 pa-1>
|
||||
<v-autocomplete
|
||||
label="Project"
|
||||
outline
|
||||
hide-details
|
||||
return-object
|
||||
item-text="label"
|
||||
:items="projectItems"
|
||||
:search-input.sync="projectSearch"
|
||||
v-model="project"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs2 pa-1>
|
||||
<v-btn color="primary" block @click="doSearch(1)">Cari</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="users" :loading="isLoading" hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left pa-2" @click="selectMe(props.item)" :class="{ 'amber lighten-4': isSelected(props.item) }">{{ props.item.User_Username }}</td>
|
||||
<td class="text-xs-left pa-2" @click="selectMe(props.item)" :class="{ 'amber lighten-4': isSelected(props.item) }">{{ props.item.User_DisplayName || '-' }}</td>
|
||||
<td class="text-xs-left pa-2" @click="selectMe(props.item)" :class="{ 'amber lighten-4': isSelected(props.item) }">
|
||||
<div v-if="props.item.projects && props.item.projects.length > 0">
|
||||
<div v-for="(p, idx) in props.item.projects" :key="idx">{{ p.project_number }} - {{ p.project_name }}</div>
|
||||
</div>
|
||||
<div v-else>-</div>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
headers: [
|
||||
{ text: 'USERNAME', align: 'Center', sortable: false, value: 'username', class: 'blue lighten-4' },
|
||||
{ text: 'NAMA', align: 'Center', sortable: false, value: 'display_name', class: 'blue lighten-4' },
|
||||
{ text: 'PROJECT', align: 'Center', sortable: false, value: 'project', class: 'blue lighten-4' }
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.doSearch(1)
|
||||
},
|
||||
computed: {
|
||||
users() { return this.$store.state.dashboard_user.users },
|
||||
isLoading() { return this.$store.state.dashboard_user.search_status == 1 },
|
||||
username: {
|
||||
get() { return this.$store.state.dashboard_user.search_username },
|
||||
set(val) { this.$store.commit('dashboard_user/update_search_username', val) }
|
||||
},
|
||||
project: {
|
||||
get() { return this.$store.state.dashboard_user.search_project },
|
||||
set(val) { this.$store.commit('dashboard_user/update_search_project', val || { mcu_id: 'all', project_number: 'All', project_name: 'Semua Project' }) }
|
||||
},
|
||||
projectSearch: {
|
||||
get() { return this.$store.state.dashboard_user.project_keyword },
|
||||
set(val) {
|
||||
let next = (val || '').trim()
|
||||
let prev = (this.$store.state.dashboard_user.project_keyword || '').trim()
|
||||
if (next === prev) return
|
||||
this.$store.commit('dashboard_user/update_project_keyword', val)
|
||||
this.thrSearchProject(next)
|
||||
}
|
||||
},
|
||||
projectItems() {
|
||||
let base = [{ mcu_id: 'all', project_number: 'All', project_name: 'Semua Project', label: 'All - Semua Project' }]
|
||||
let records = (this.$store.state.dashboard_user.project_options || []).map(p => {
|
||||
return Object.assign({}, p, { label: p.project_number + ' - ' + p.project_name })
|
||||
})
|
||||
return base.concat(records)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
thrSearchProject: _.debounce(function(keyword) {
|
||||
this.$store.dispatch('dashboard_user/search_project', { search: keyword || '' })
|
||||
}, 300),
|
||||
doSearch() {
|
||||
this.$store.dispatch('dashboard_user/search', {
|
||||
username: this.username || '',
|
||||
project: this.project && this.project.mcu_id ? this.project.mcu_id : 'all',
|
||||
page: 1,
|
||||
limit: this.$store.state.dashboard_user.limit
|
||||
})
|
||||
},
|
||||
selectMe(item) {
|
||||
this.$store.commit('dashboard_user/update_selected_user', item)
|
||||
},
|
||||
isSelected(item) {
|
||||
return this.$store.state.dashboard_user.selected_user.User_ID == item.User_ID
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
66
test/vuex/dashboard-user-mcu/index.php
Normal file
66
test/vuex/dashboard-user-mcu/index.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<!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>Dashboard User MCU</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 style="background:#F5E8DF!important">
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs6 class="left" fill-height pa-1>
|
||||
<one-dashboard-user-mcu-list></one-dashboard-user-mcu-list>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="right" fill-height pa-1>
|
||||
<one-dashboard-user-mcu-detail></one-dashboard-user-mcu-detail>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer></one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-dashboard-user-mcu-list': httpVueLoader('./components/oneDashboardUserMcuList.vue'),
|
||||
'one-dashboard-user-mcu-detail': httpVueLoader('./components/oneDashboardUserMcuDetail.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] { display: none }
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
155
test/vuex/dashboard-user-mcu/modules/dashboard_user.js
Normal file
155
test/vuex/dashboard-user-mcu/modules/dashboard_user.js
Normal file
@@ -0,0 +1,155 @@
|
||||
import * as api from "../api/dashboard_user.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
users: [],
|
||||
selected_user: {},
|
||||
project_options: [],
|
||||
search_username: '',
|
||||
search_project: { mcu_id: 'all', project_number: 'All', project_name: 'Semua Project' },
|
||||
project_keyword: '',
|
||||
page: 1,
|
||||
limit: 20,
|
||||
total_rows: 0,
|
||||
total_pages: 0,
|
||||
search_status: 0,
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
dialog_success: false,
|
||||
msg_success: ''
|
||||
},
|
||||
mutations: {
|
||||
update_users(state, val) { state.users = val },
|
||||
update_selected_user(state, val) { state.selected_user = val },
|
||||
update_project_options(state, val) { state.project_options = val },
|
||||
update_search_username(state, val) { state.search_username = val },
|
||||
update_search_project(state, val) { state.search_project = val },
|
||||
update_project_keyword(state, val) { state.project_keyword = val },
|
||||
update_page(state, val) { state.page = val },
|
||||
update_limit(state, val) { state.limit = val },
|
||||
update_total_rows(state, val) { state.total_rows = val },
|
||||
update_total_pages(state, val) { state.total_pages = val },
|
||||
update_search_status(state, val) { state.search_status = val },
|
||||
update_save_status(state, val) { state.save_status = val },
|
||||
update_save_error_message(state, val) { state.save_error_message = val },
|
||||
update_dialog_success(state, val) { state.dialog_success = val },
|
||||
update_msg_success(state, val) { state.msg_success = val }
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit('update_search_status', 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status != 'OK') {
|
||||
context.commit('update_search_status', 3)
|
||||
context.commit('update_save_error_message', resp.message)
|
||||
} else {
|
||||
let data = resp.data || {}
|
||||
let records = data.records || []
|
||||
context.commit('update_users', records)
|
||||
context.commit('update_total_rows', data.pagination ? data.pagination.total_rows : 0)
|
||||
context.commit('update_total_pages', data.pagination ? data.pagination.total_pages : 0)
|
||||
context.commit('update_limit', data.pagination ? data.pagination.limit : 20)
|
||||
let selected = context.state.selected_user || {}
|
||||
if (selected.User_ID) {
|
||||
let refreshed = records.find(function (item) {
|
||||
return item.User_ID == selected.User_ID
|
||||
})
|
||||
if (refreshed) {
|
||||
context.commit('update_selected_user', refreshed)
|
||||
}
|
||||
}
|
||||
context.commit('update_search_status', 2)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit('update_search_status', 3)
|
||||
context.commit('update_save_error_message', e.message)
|
||||
}
|
||||
},
|
||||
async search_project(context, prm) {
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.search_project(prm)
|
||||
if (resp.status != 'OK') {
|
||||
context.commit('update_project_options', [])
|
||||
} else {
|
||||
context.commit('update_project_options', resp.data.records || [])
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit('update_project_options', [])
|
||||
}
|
||||
},
|
||||
async save(context, prm) {
|
||||
context.commit('update_save_status', 1)
|
||||
prm.token = one_token()
|
||||
let resp = await api.save(prm)
|
||||
if (resp.status != 'OK') {
|
||||
context.commit('update_save_status', 3)
|
||||
context.commit('update_save_error_message', resp.message)
|
||||
return resp
|
||||
}
|
||||
context.commit('update_save_status', 2)
|
||||
context.commit('update_msg_success', (resp.data && resp.data.message) ? resp.data.message : 'User berhasil disimpan')
|
||||
context.commit('update_dialog_success', true)
|
||||
return resp
|
||||
},
|
||||
async reset_password(context, prm) {
|
||||
context.commit('update_save_status', 1)
|
||||
prm.token = one_token()
|
||||
let resp = await api.reset_password(prm)
|
||||
if (resp.status != 'OK') {
|
||||
context.commit('update_save_status', 3)
|
||||
context.commit('update_save_error_message', resp.message)
|
||||
return resp
|
||||
}
|
||||
context.commit('update_save_status', 2)
|
||||
context.commit('update_msg_success', (resp.data && resp.data.message) ? resp.data.message : 'Password berhasil direset')
|
||||
context.commit('update_dialog_success', true)
|
||||
return resp
|
||||
},
|
||||
async remove_user(context, prm) {
|
||||
context.commit('update_save_status', 1)
|
||||
prm.token = one_token()
|
||||
let resp = await api.remove_user(prm)
|
||||
if (resp.status != 'OK') {
|
||||
context.commit('update_save_status', 3)
|
||||
context.commit('update_save_error_message', resp.message)
|
||||
return resp
|
||||
}
|
||||
context.commit('update_save_status', 2)
|
||||
context.commit('update_msg_success', (resp.data && resp.data.message) ? resp.data.message : 'User berhasil dihapus')
|
||||
context.commit('update_dialog_success', true)
|
||||
return resp
|
||||
},
|
||||
async assign_project(context, prm) {
|
||||
context.commit('update_save_status', 1)
|
||||
prm.token = one_token()
|
||||
let resp = await api.assign_project(prm)
|
||||
if (resp.status != 'OK') {
|
||||
context.commit('update_save_status', 3)
|
||||
context.commit('update_save_error_message', resp.message)
|
||||
return resp
|
||||
}
|
||||
context.commit('update_save_status', 2)
|
||||
context.commit('update_msg_success', (resp.data && resp.data.message) ? resp.data.message : 'Project berhasil di-assign')
|
||||
context.commit('update_dialog_success', true)
|
||||
return resp
|
||||
},
|
||||
async remove_project(context, prm) {
|
||||
context.commit('update_save_status', 1)
|
||||
prm.token = one_token()
|
||||
let resp = await api.remove_project(prm)
|
||||
if (resp.status != 'OK') {
|
||||
context.commit('update_save_status', 3)
|
||||
context.commit('update_save_error_message', resp.message)
|
||||
return resp
|
||||
}
|
||||
context.commit('update_save_status', 2)
|
||||
context.commit('update_msg_success', (resp.data && resp.data.message) ? resp.data.message : 'Project berhasil dihapus')
|
||||
context.commit('update_dialog_success', true)
|
||||
return resp
|
||||
}
|
||||
}
|
||||
}
|
||||
12
test/vuex/dashboard-user-mcu/store.js
Normal file
12
test/vuex/dashboard-user-mcu/store.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import dashboard_user from "./modules/dashboard_user.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
dashboard_user: dashboard_user,
|
||||
system: system
|
||||
},
|
||||
state: {},
|
||||
mutations: {},
|
||||
actions: {}
|
||||
});
|
||||
92
test/vuex/one-fo-registration-walk-in-stemcell/api/area.js
Normal file
92
test/vuex/one-fo-registration-walk-in-stemcell/api/area.js
Normal file
@@ -0,0 +1,92 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/clinic/fo/";
|
||||
|
||||
export async function search_province(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_province', {
|
||||
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_city(province_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_city', {
|
||||
search: search,
|
||||
province_id: province_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_district(city_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_district', {
|
||||
search: search,
|
||||
city_id: city_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_kelurahan(district_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'area/search_kelurahan', {
|
||||
search: search,
|
||||
district_id: district_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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
const URL = "/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
|
||||
export async function search(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'company/search',{search:search,token:window.one_token()});
|
||||
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_default() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'company/search_default');
|
||||
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_project(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'company/search_project',prm);
|
||||
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_fisik_template(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'company/search_fisik_template',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
|
||||
export async function search(o_id, p_id, d_id, m_id,c_id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'delivery/search', { order_id: o_id, patient_id: p_id, doctor_id: d_id, mou_id: m_id,c_id:c_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_deliveries(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'delivery/search_deliveries', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
119
test/vuex/one-fo-registration-walk-in-stemcell/api/doctor.js
Normal file
119
test/vuex/one-fo-registration-walk-in-stemcell/api/doctor.js
Normal file
@@ -0,0 +1,119 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
let doctor_search_token ={};
|
||||
|
||||
|
||||
export async function search(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'doctor/search', { search: search, token: window.one_token() });
|
||||
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 searchPj() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'doctor/search_pj', { token: window.one_token() });
|
||||
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_fpptype(search) {
|
||||
try {
|
||||
console.log("search indx fpp type")
|
||||
//console.log("cdssdv ", fpptype_search_token.hasOwnProperty("token")?'ada':'tidak ada')
|
||||
// Jika ada request sebelumnya, batalkan
|
||||
|
||||
console.log("search now fpp type")
|
||||
// Buat token baru untuk request ini
|
||||
//fpptype_search_token = axios.CancelToken.source();
|
||||
var resp = await axios.post(URL + 'doctor/search_fpptype', {
|
||||
search: search,
|
||||
token: window.one_token()
|
||||
});
|
||||
|
||||
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_fpptype(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'doctor/search_fpptype', {
|
||||
search: search,
|
||||
token: window.one_token()
|
||||
});
|
||||
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, d) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'doctor/save', {
|
||||
token: token,
|
||||
data: d
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
|
||||
export async function search(patient_id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'history/search', {
|
||||
patient_id: patient_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 get_databyorder_id(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'history/get_databyorder_id', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
|
||||
export async function search() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'language/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
|
||||
};
|
||||
}
|
||||
}
|
||||
205
test/vuex/one-fo-registration-walk-in-stemcell/api/order.js
Normal file
205
test/vuex/one-fo-registration-walk-in-stemcell/api/order.js
Normal file
@@ -0,0 +1,205 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
|
||||
let isSaving = false;
|
||||
|
||||
export async function save(prm) {
|
||||
if (isSaving) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: "Save operation is already in progress"
|
||||
}
|
||||
}
|
||||
|
||||
isSaving = true;
|
||||
try {
|
||||
var resp = await axios.post(URL + 'order/save', prm);
|
||||
isSaving = false;
|
||||
return resp
|
||||
} catch (e) {
|
||||
isSaving = false;
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function lookupbarcodes(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'order/lookup_barcodes', prm);
|
||||
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 load_from_clinic(queue) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'order/load_from_clinic', {
|
||||
queue: queue
|
||||
});
|
||||
|
||||
return resp
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function load_preregister(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'order/load_preregister',prm);
|
||||
|
||||
return resp
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function load(id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'order/load', {
|
||||
id: id
|
||||
});
|
||||
|
||||
return resp
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function patientSearch(noreg, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search', {
|
||||
search: search,
|
||||
noreg: noreg
|
||||
});
|
||||
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 doctorSearch(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'doctor/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 doctorSearchPj() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'doctor/search_pj', { });
|
||||
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 languageSearch() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'language/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 deliverySearch() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'delivery/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 get_time_start(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'order/get_time_start', prm);
|
||||
|
||||
return resp
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
133
test/vuex/one-fo-registration-walk-in-stemcell/api/other.js
Normal file
133
test/vuex/one-fo-registration-walk-in-stemcell/api/other.js
Normal file
@@ -0,0 +1,133 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/clinic/fo/";
|
||||
|
||||
export async function search_sex(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sex/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_title(search, sex) {
|
||||
try {
|
||||
var resp = await axios.post('/one-api/mockup/fo/walk_in_registration/' + 'patient/get_titles', {
|
||||
search: search,
|
||||
sex_id: sex
|
||||
});
|
||||
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_bank(search, card, edc) {
|
||||
try {
|
||||
if (card == null)
|
||||
card = undefined
|
||||
var resp = await axios.post("/one-api/mockup/fo/registration/" + 'bank/search', {
|
||||
search: search,
|
||||
card: card,
|
||||
edc: edc
|
||||
});
|
||||
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_accounts(search) {
|
||||
try {
|
||||
var resp = await axios.post("/one-api/mockup/fo/registration/" + 'bank/search_account', {
|
||||
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_religion(prm) {
|
||||
try {
|
||||
var resp = await axios.post("/one-api/mockup/fo/walk_in_registration/" + 'patient/get_religions', prm);
|
||||
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 get_titles(prm) {
|
||||
try {
|
||||
var resp = await axios.post("/one-api/mockup/fo/walk_in_registration/" + 'patient/get_titles', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
263
test/vuex/one-fo-registration-walk-in-stemcell/api/patient.js
Normal file
263
test/vuex/one-fo-registration-walk-in-stemcell/api/patient.js
Normal file
@@ -0,0 +1,263 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
|
||||
export async function search(noreg, search, current_page) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search', {
|
||||
search: search,
|
||||
noreg: noreg,
|
||||
current_page:current_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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function add_new(datas) {
|
||||
try {
|
||||
//sipe add token
|
||||
datas["token"] = window.one_token();
|
||||
var resp = await axios.post(URL + 'patient/add_new', datas);
|
||||
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 edit(datas, id) {
|
||||
try {
|
||||
//sipe add token
|
||||
datas["token"] = window.one_token();
|
||||
datas["id"] = id
|
||||
var resp = await axios.post(URL + 'patient/edit', datas);
|
||||
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_idtype() {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search_idtype', {token:window.one_token()});
|
||||
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 searchregion(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/searchregion', {
|
||||
search: prm,
|
||||
token: window.one_token()
|
||||
});
|
||||
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_countries(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search_countries', {
|
||||
search: prm,
|
||||
token: window.one_token()
|
||||
});
|
||||
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_corporate(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search_corporate', {
|
||||
search: prm,
|
||||
token: window.one_token()
|
||||
});
|
||||
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_blood_type(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search_blood_type', {
|
||||
search: prm,
|
||||
token: window.one_token()
|
||||
});
|
||||
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_blood_rh_type(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search_blood_rh_type', {
|
||||
search: prm,
|
||||
token: window.one_token()
|
||||
});
|
||||
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_education_type(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search_education_type', {
|
||||
search: prm,
|
||||
token: window.one_token()
|
||||
});
|
||||
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_etnic_type(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/search_etnic_type', {
|
||||
search: prm,
|
||||
token: window.one_token()
|
||||
});
|
||||
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_icd10(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'order/search_icd10', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
|
||||
export async function getAll(id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patientaddress/get_all', {
|
||||
patient_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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
const URL = "/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
|
||||
export async function get_order(id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'payment/get_order',{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(search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'payment/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 save(token, order_id, payments) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'payment/save', {
|
||||
token: token,
|
||||
order_id: order_id,
|
||||
payments: payments
|
||||
});
|
||||
|
||||
return resp
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function endshowtime(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'order/endshowtime',prm);
|
||||
|
||||
return resp
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function get_details_order(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'order/get_details_order', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
28
test/vuex/one-fo-registration-walk-in-stemcell/api/photo.js
Normal file
28
test/vuex/one-fo-registration-walk-in-stemcell/api/photo.js
Normal file
@@ -0,0 +1,28 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
|
||||
export async function upload(token, id, datas) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'photo/upload', {
|
||||
token: token,
|
||||
id: id,
|
||||
data: datas
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
254
test/vuex/one-fo-registration-walk-in-stemcell/api/px.js
Normal file
254
test/vuex/one-fo-registration-walk-in-stemcell/api/px.js
Normal file
@@ -0,0 +1,254 @@
|
||||
// API :
|
||||
// search bank
|
||||
// paramater : query , page , rowPerPage
|
||||
const URL =
|
||||
"/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
|
||||
|
||||
export async function search(mouCompanyID, search, token, project_id = 0) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/search_v2', {
|
||||
search: search,
|
||||
mouCompanyID: mouCompanyID,
|
||||
project_id: project_id,
|
||||
token: one_token()
|
||||
},{
|
||||
cancelToken: token
|
||||
});
|
||||
|
||||
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 panel(mouCompanyID,search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/panel', {
|
||||
search:search,
|
||||
mouCompanyID:mouCompanyID
|
||||
});
|
||||
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 packet_reqs(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/packet_reqs',prm);
|
||||
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 profile(mou_id, search) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/profile', {
|
||||
search: search,
|
||||
mou_id: mou_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 get_price(test_id, mou_id, cito) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/get_price', {
|
||||
test_id:test_id,
|
||||
mou_id:mou_id,
|
||||
cito:cito
|
||||
});
|
||||
|
||||
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 appx_schedule(test_ids, panel_ids) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/get_appx_schedule', {
|
||||
test_ids:test_ids,
|
||||
panel_ids:panel_ids,
|
||||
token:one_token()
|
||||
});
|
||||
|
||||
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_cito(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/search_cito', {
|
||||
token:token
|
||||
});
|
||||
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_pxs(mouCompanyID, id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/search_v2', {
|
||||
order_id:id,
|
||||
mouCompanyID:mouCompanyID,
|
||||
token: one_token()
|
||||
});
|
||||
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_pxs_clinic(mouCompanyID, id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/search', {
|
||||
clinic_id:id,
|
||||
mouCompanyID:mouCompanyID
|
||||
});
|
||||
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 get_promise_by_pxs(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/get_promise_by_pxs', prm);
|
||||
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 get_requirement(test_id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'px/get_requirement', {
|
||||
test_id: test_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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
const URL = "/one-api/mockup/fo/walk_in_registration_stemcell/";
|
||||
|
||||
export async function searchreference(search = "") {
|
||||
try {
|
||||
const resp = await axios.post(URL + "reference/searchreference", {
|
||||
token: window.one_token(),
|
||||
search: search || ""
|
||||
});
|
||||
|
||||
if (resp.status !== 200) {
|
||||
return { status: "ERR", message: resp.statusText };
|
||||
}
|
||||
|
||||
return resp.data;
|
||||
} catch (e) {
|
||||
return { status: "ERR", message: e.message };
|
||||
}
|
||||
}
|
||||
|
||||
export async function searchordertype(search = "") {
|
||||
try {
|
||||
const resp = await axios.post(URL + "reference/searchordertype", {
|
||||
token: window.one_token(),
|
||||
search: search || ""
|
||||
});
|
||||
|
||||
if (resp.status !== 200) {
|
||||
return { status: "ERR", message: resp.statusText };
|
||||
}
|
||||
|
||||
return resp.data;
|
||||
} catch (e) {
|
||||
return { status: "ERR", message: e.message };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
full-width
|
||||
>
|
||||
<v-btn
|
||||
color="blue"
|
||||
slot="activator"
|
||||
dark
|
||||
block
|
||||
@click="search"
|
||||
>
|
||||
Cari
|
||||
</v-btn>
|
||||
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
Data Pasien
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<patient-search-result></patient-search-result>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="primary"
|
||||
flat
|
||||
@click="dialog = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'patient-search-result': httpVueLoader('./patientSearchResult.vue')
|
||||
},
|
||||
methods : {
|
||||
search: function() {
|
||||
this.$store.dispatch('patient/search')
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
dialog: {
|
||||
get() {
|
||||
return this.$store.state.patient.search_dialog_is_active;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_search_dialog_is_active',val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
:overlay="true"
|
||||
|
||||
max-width="300px"
|
||||
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title primary-title class="headline grey lighten-2">
|
||||
Ambil / Upload Foto
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-card fill-height flat>
|
||||
|
||||
<v-card-text class="pb-0">
|
||||
<v-card
|
||||
class="photo_box"
|
||||
id="photo_box"
|
||||
elevation="24"
|
||||
>
|
||||
<div class="photo_inside" id="photo_inside" v-show="camera">
|
||||
asasdasd ads asd ad ad as da sd a das d sa das d ad as d as dsa ds ad asd sa das d asd as da sd sad as das das d asd sa das d sad as da sd
|
||||
</div>
|
||||
|
||||
<div class="photo_inside" id="photo_inside_2" v-show="!camera">
|
||||
<v-img
|
||||
:src="imageUrl"
|
||||
aspect-ratio="1.34"
|
||||
class="grey lighten-2 elevation-2"
|
||||
contain
|
||||
>
|
||||
<!-- <img :src="imageUrl" height="150" v-if="imageUrl"/> -->
|
||||
</div>
|
||||
</v-card>
|
||||
<v-btn color="success" block @click="snap_photo" v-show="camera">Ambil Foto</v-btn>
|
||||
<v-btn color="orange" dark block @click="camera = true" v-show="!camera">Gunakan Kamera</v-btn>
|
||||
|
||||
<v-divider>xxxx</v-divider>
|
||||
|
||||
<v-flex xs12 class="text-xs-center">
|
||||
atau
|
||||
</v-flex>
|
||||
<v-flex xs12 class="text-xs-center text-sm-center text-md-center text-lg-center">
|
||||
|
||||
<v-text-field label="Pilih Gambar" hide-details @click='pickFile' v-model='imageName' prepend-icon='attach_file' class="mt-2"></v-text-field>
|
||||
<input
|
||||
type="file"
|
||||
style="display: none"
|
||||
ref="image"
|
||||
accept="image/*"
|
||||
@change="onFilePicked"
|
||||
>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-btn color="success" block @click="upload" :disabled="camera" :dark="!camera">Simpan</v-btn>
|
||||
</v-flex>
|
||||
</v-card-text>
|
||||
|
||||
</v-card>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="primary"
|
||||
flat
|
||||
@click="dialog = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
|
||||
</v-card>
|
||||
|
||||
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.photo_box {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.photo_inside {
|
||||
/* position: absolute;
|
||||
top: 0;
|
||||
left: 0; */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#photo_inside_2 {
|
||||
min-height: 201px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data () {
|
||||
return {
|
||||
title: "Image Upload",
|
||||
imageName: '',
|
||||
imageUrl: '',
|
||||
imageFile: '',
|
||||
camera: true
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
dialog : {
|
||||
get () { return this.$store.state.photo.dialog_photo },
|
||||
set (v) { this.$store.commit('photo/update_dialog_photo', v) }
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
snap_photo() {
|
||||
var str = this.$store
|
||||
Webcam.snap(function(data_uri) {
|
||||
// document.getElementById('photo_result').innerHTML = '<img src="'+data_uri+'"/>';
|
||||
// console.log(data_uri)
|
||||
str.commit('photo/update_photo_64', data_uri)
|
||||
str.dispatch('photo/upload')
|
||||
})
|
||||
delete str
|
||||
},
|
||||
|
||||
pickFile () {
|
||||
this.$refs.image.click ()
|
||||
},
|
||||
|
||||
onFilePicked (e) {
|
||||
this.camera = false
|
||||
console.log(this.camera)
|
||||
const files = e.target.files
|
||||
if(files[0] !== undefined) {
|
||||
this.imageName = files[0].name
|
||||
if(this.imageName.lastIndexOf('.') <= 0) {
|
||||
return
|
||||
}
|
||||
const fr = new FileReader ()
|
||||
fr.readAsDataURL(files[0])
|
||||
fr.addEventListener('load', () => {
|
||||
this.imageUrl = fr.result
|
||||
this.imageFile = files[0] // this is an image file that can be sent to server...
|
||||
})
|
||||
|
||||
|
||||
} else {
|
||||
this.imageName = ''
|
||||
this.imageFile = ''
|
||||
this.imageUrl = ''
|
||||
}
|
||||
},
|
||||
|
||||
upload () {
|
||||
this.$store.commit('photo/update_photo_64', this.imageUrl)
|
||||
this.$store.dispatch('photo/upload')
|
||||
}
|
||||
},
|
||||
|
||||
watch : {
|
||||
dialog (n, o) {
|
||||
if (n == true) {
|
||||
this.camera = true
|
||||
Webcam.set({
|
||||
width: 268,
|
||||
height: 201,
|
||||
image_format: 'jpeg',
|
||||
jpeg_quality: 90,
|
||||
dest_width: 640,
|
||||
dest_height: 480
|
||||
});
|
||||
Webcam.attach( '#photo_inside' );
|
||||
} else {
|
||||
Webcam.reset()
|
||||
}
|
||||
},
|
||||
|
||||
camera (n, o) {
|
||||
if (n == true) {
|
||||
this.imageName = ''
|
||||
this.imageFile = ''
|
||||
this.imageUrl = ''
|
||||
|
||||
Webcam.set({
|
||||
width: 268,
|
||||
height: 201,
|
||||
image_format: 'jpeg',
|
||||
jpeg_quality: 90,
|
||||
dest_width: 640,
|
||||
dest_height: 480
|
||||
});
|
||||
Webcam.attach( '#photo_inside' );
|
||||
} else {
|
||||
Webcam.reset()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -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.order.print_dialog_is_active;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('order/update_print_dialog_is_active', val);
|
||||
}
|
||||
},
|
||||
|
||||
rpt_url () {
|
||||
return this.$store.state.order.rpt_url
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<v-flex class="pl-2">
|
||||
<v-layout row>
|
||||
<v-checkbox @change="checkedChange()"
|
||||
:color="value.checked ? 'success' : 'warning' "
|
||||
v-model="value.checked" hide-details class="shrink">
|
||||
</v-checkbox>
|
||||
<v-text-field
|
||||
class="grow"
|
||||
:label="value.label"
|
||||
:placeholder="value.placeholder"
|
||||
:background-color="value.checked ? 'success' : value.note == '' ? 'error' : 'warning' "
|
||||
outline
|
||||
:error-messages="value.is_error? value.error_message : ''"
|
||||
:error="value.is_error"
|
||||
v-model="value.note"
|
||||
@input="noteChange()"
|
||||
></v-text-field>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props : ['value'],
|
||||
methods : {
|
||||
noteChange(note) {
|
||||
if (! this.value.checked ) {
|
||||
this.value.is_error = this.value.note.trim() == ""
|
||||
} else {
|
||||
this.value.is_error = false
|
||||
this.value.note = ""
|
||||
}
|
||||
this.$emit("input", this.value )
|
||||
},
|
||||
checkedChange() {
|
||||
if (this.value.checked) {
|
||||
this.value.note = "";
|
||||
this.value.is_error = false;
|
||||
} else {
|
||||
this.value.is_error = (this.value.note.trim() == "" )
|
||||
}
|
||||
this.$emit("input", this.value)
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog" width="600" persistent>
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
||||
Pendaftaran Berhasil
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<h6 class="display-1 text-center">
|
||||
No Reg <span class="blue--text">{{ text_labno }}</span>
|
||||
</h6>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="info" flat @click="printQrcode"> Print Qrcode </v-btn>
|
||||
<v-btn color="success" flat @click="printBarcode">
|
||||
Print Barcode
|
||||
</v-btn>
|
||||
<v-btn color="warning" @click="goToCashier"> Bayar </v-btn>
|
||||
<v-btn color="primary" flat @click="finish"> Tutup </v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {},
|
||||
methods: {
|
||||
finish: function () {
|
||||
this.dialog = false;
|
||||
this.$store.commit("order/update_tab_enable", [0, false]);
|
||||
this.$store.commit("order/update_tab_enable", [1, false]);
|
||||
let url_string = window.location.href
|
||||
let url = new URL(url_string);
|
||||
let pre_id = url.searchParams.get("pre_id")
|
||||
this.$store.dispatch("payment/reset", {
|
||||
order_id: this.$store.state.order.current_order.order_id,
|
||||
time_start: this.$store.state.order.show_time,
|
||||
type: 'walk_in',
|
||||
url: this.xurl
|
||||
});
|
||||
},
|
||||
goToCashier() {
|
||||
this.$store.dispatch("payment/reset", {
|
||||
order_id: this.$store.state.order.current_order.order_id,
|
||||
time_start: this.$store.state.order.show_time,
|
||||
type: 'pay',
|
||||
url: this.xurl
|
||||
});
|
||||
},
|
||||
printBarcode() {
|
||||
one_print_barcode_formulir(this.text_labid);
|
||||
this.$store.dispatch("order/getbarcode", {
|
||||
id: this.text_labid,
|
||||
no_lab: this.text_labno,
|
||||
name: this.text_labname,
|
||||
register_date: this.text_labdate,
|
||||
});
|
||||
},
|
||||
printQrcode() {
|
||||
let inp = {};
|
||||
inp.id = this.text_labid;
|
||||
inp.no_lab = this.text_labno;
|
||||
inp.name = this.text_labname;
|
||||
inp.register_date = this.text_labdate;
|
||||
inp.uuid = this.uuid;
|
||||
inp.form_code = this.$store.state.order.form_code;
|
||||
inp.url_qrform = this.$store.state.order.url_qrform;
|
||||
one_print_qrcode_form(inp);
|
||||
one_print_qrcode(inp);
|
||||
one_print_qrcode_patient(inp);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
dialog: {
|
||||
get() {
|
||||
return this.$store.state.order.finish_dialog_is_active;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("order/update_finish_dialog_is_active", val);
|
||||
},
|
||||
},
|
||||
text_labno() {
|
||||
return this.$store.state.order.current_order.noreg;
|
||||
},
|
||||
text_labid() {
|
||||
return this.$store.state.order.current_order.order_id;
|
||||
},
|
||||
text_labname() {
|
||||
return this.$store.state.order.current_order.order_header.patient_name;
|
||||
},
|
||||
text_labdate() {
|
||||
return this.$store.state.order.current_order.order_header.order_date;
|
||||
},
|
||||
xurl() {
|
||||
return this.$store.state.order.current_order.url;
|
||||
},
|
||||
uuid() {
|
||||
return this.$store.state.order.uuid;
|
||||
},
|
||||
form_code() {
|
||||
return this.$store.state.order.form_code;
|
||||
},
|
||||
url_qrform() {
|
||||
return this.$store.state.order.url_qrform;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,347 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-layout column pb-2>
|
||||
<v-card class="pa-1 mb-2" height="100%">
|
||||
<v-layout align-center row>
|
||||
<v-flex xs12>
|
||||
<v-card tile class="pa-2" flat color="#64b2cd">
|
||||
<h5 style="color:#fff" class="subtitle-1 font-weight-bold">PROYEK DAN FISIK TEMPLATE DAN AGREEMENT</h5>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs6 class="pa-2">
|
||||
<v-autocomplete
|
||||
label="Proyek"
|
||||
v-model="selected_project"
|
||||
:items="projects"
|
||||
:search-input.sync="search_project"
|
||||
auto-select-first
|
||||
style="font-size:12px;padding:4px 0"
|
||||
no-filter
|
||||
:readonly="isHavingTest"
|
||||
return-object
|
||||
clearable
|
||||
:item-text="item => item.code + ' - ' + item.label"
|
||||
:loading="is_loading_project"
|
||||
color="primary"
|
||||
no-data-text="Pilih Proyek"
|
||||
hide-details
|
||||
>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="pa-2">
|
||||
<v-autocomplete
|
||||
label="Fisik Template"
|
||||
v-model="selected_fisik_template"
|
||||
:items="fisik_templates"
|
||||
:search-input.sync="search_fisik_template"
|
||||
auto-select-first
|
||||
style="font-size:12px;padding:4px 0"
|
||||
:readonly="!_.isEmpty(selected_project) || isHavingTest"
|
||||
no-filter
|
||||
return-object
|
||||
:clearable="_.isEmpty(selected_project)"
|
||||
:item-text="item => item.fisik_template_label"
|
||||
:loading="is_loading_fisik_template"
|
||||
color="primary"
|
||||
no-data-text="Pilih Fisik Template"
|
||||
hide-details
|
||||
>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-card class="pa-1 mb-0" >
|
||||
<v-layout align-center row>
|
||||
<v-flex xs12>
|
||||
<v-card tile class="pa-2" flat color="#64b2cd">
|
||||
<h5 style="color:#fff" class="subtitle-1 font-weight-bold">KEL. PELANGGAN DAN AGREEMENT</h5>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout v-if="!_.isEmpty(selected_project)" class="pb-2" row>
|
||||
<v-flex pt-1 pl-2 pr-1 xs6>
|
||||
<v-text-field
|
||||
label="Kel. Pelanggan"
|
||||
:value="selected_company.CorporateName"
|
||||
readonly
|
||||
hide-details
|
||||
style="font-size:12px;"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex pt-1 pl-2 pr-1 xs6>
|
||||
<v-text-field
|
||||
label="Agreement"
|
||||
:value="selected_mou.price_header_name"
|
||||
readonly
|
||||
hide-details
|
||||
style="font-size:12px;"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout v-if="_.isEmpty(selected_project)" row>
|
||||
<v-flex pt-1 pl-2 pr-1 xs6>
|
||||
<v-autocomplete
|
||||
label="Kel. Pelanggan"
|
||||
v-model="selected_company"
|
||||
:items="companies"
|
||||
style="font-size:12px;"
|
||||
:search-input.sync="search"
|
||||
:readonly="isHavingTest"
|
||||
auto-select-first
|
||||
no-filter
|
||||
hide-details
|
||||
return-object
|
||||
|
||||
item-text="CorporateName"
|
||||
:loading="is_loading"
|
||||
color="primary"
|
||||
no-data-text="Pilih Kel. Pelanggan"
|
||||
>
|
||||
<template
|
||||
slot="item"
|
||||
slot-scope="{ item }"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.CorporateName"></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-flex>
|
||||
<v-flex pt-1 pl-1 pr-2 xs6>
|
||||
<v-select
|
||||
v-model="selected_mou"
|
||||
:items="company_mou"
|
||||
:readonly="isHavingTest"
|
||||
style="font-size:12px;"
|
||||
auto-select-first
|
||||
item-text = "price_header_name"
|
||||
return-object
|
||||
label="Agreement"
|
||||
hide-details
|
||||
class="mb-1"
|
||||
>
|
||||
<template
|
||||
slot="item"
|
||||
slot-scope="{ item }"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.price_header_name"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-text="getMouDate(item)"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-select>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout v-if="selected_mou_note.length > 0" mt-1 pt-1 pl-2 pr-2 style="border:1px dashed #64b2cd" row>
|
||||
<v-flex xs12>
|
||||
<p class="mb-1"><kbd style="background:#ec4d4d">Catatan :</kbd></p>
|
||||
<p v-for="(note, n) in selected_mou_note" v-bind:key="n" class="mb-1 caption">{{ note }}</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
computed: {
|
||||
is_loading_fisik_template(){
|
||||
return this.$store.state.company.is_loading_fisik_template === true || this.$store.state.company.is_loading_fisik_template === 1
|
||||
},
|
||||
fisik_templates: {
|
||||
get(){
|
||||
return this.$store.state.company.fisik_templates
|
||||
},
|
||||
set(val){
|
||||
this.$store.commit('company/update_fisik_templates',val)
|
||||
}
|
||||
},
|
||||
selected_fisik_template:{
|
||||
get(){
|
||||
return this.$store.state.company.selected_fisik_template
|
||||
},
|
||||
set(val){
|
||||
this.$store.commit('company/update_selected_fisik_template',val)
|
||||
}
|
||||
},
|
||||
is_loading_project(){
|
||||
return this.$store.state.company.is_loading_project === true || this.$store.state.company.is_loading_project === 1
|
||||
},
|
||||
projects(){
|
||||
return this.$store.state.company.projects
|
||||
},
|
||||
selected_project:{
|
||||
get(){
|
||||
return this.$store.state.company.selected_project
|
||||
},
|
||||
set(val){
|
||||
this.$store.commit('company/update_selected_project',val)
|
||||
if(val && !_.isEmpty(val)){
|
||||
this.search_fisik_template = val.fisik_mapping_label;
|
||||
this.selected_fisik_template = {fisik_template_label:val.fisik_mapping_label,fisik_template_id:val.fisik_mapping_id}
|
||||
this.selected_company = {CorporateName:val.CorporateName,CorporateID:val.CorporateID,corporate_prices:val.corporate_prices}
|
||||
this.companies = [this.selected_company]
|
||||
}else{
|
||||
this.search_fisik_template = ''
|
||||
this.selected_fisik_template = {}
|
||||
this.selected_company = {}
|
||||
this.companies = []
|
||||
}
|
||||
}
|
||||
},
|
||||
order_companies(){
|
||||
return this.$store.state.company.order_companies
|
||||
},
|
||||
show_doctor_alert(){
|
||||
return this.$store.state.doctor.show_doctor_alert
|
||||
},
|
||||
search:{
|
||||
get(){
|
||||
return this.$store.state.company.search
|
||||
},
|
||||
set(val) {
|
||||
if (val == null) return
|
||||
this.$store.commit('company/update_search',val)
|
||||
}
|
||||
},
|
||||
isHavingTest() {
|
||||
return this.$store.state.px.selected_test.length > 0 ||
|
||||
this.$store.state.px.selected_panel.length > 0
|
||||
},
|
||||
selected_mou: {
|
||||
get() {
|
||||
return this.$store.state.company.selected_mou
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("px/update_tests",{records:[],total:0})
|
||||
this.$store.commit("company/update_selected_mou", val)
|
||||
if(val && !_.isEmpty(val)){
|
||||
console.log('in not empty');
|
||||
console.log('mulai cari px dari mou');
|
||||
this.$store.dispatch('px/search');
|
||||
}else{
|
||||
console.log('in empty');
|
||||
this.$store.commit("px/update_tests",{records:[],total:0})
|
||||
}
|
||||
}
|
||||
},
|
||||
selected_company: {
|
||||
get() {
|
||||
return this.$store.state.company.selected_company
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_selected_company", val)
|
||||
this.$store.dispatch('delivery/search_deliveries',{type:'company',id:val.CorporateID})
|
||||
console.log(val);
|
||||
if(val && !_.isEmpty(val)){
|
||||
this.$store.commit("px/update_tests",{records:[],total:0})
|
||||
if(val.corporate_prices.length > 0){
|
||||
let prices = val.corporate_prices;
|
||||
let _this = this;
|
||||
prices.forEach(function(price){
|
||||
if(price.is_default == 'Y'){
|
||||
_this.selected_mou = price;
|
||||
console.log('selected_mou_default', _this.selected_mou);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
this.$store.commit("px/update_tests",{records:[],total:0})
|
||||
}
|
||||
}else{
|
||||
this.$store.commit("px/update_tests",{records:[],total:0})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
company_mou() {
|
||||
if (! this.$store.state.company.selected_company) return []
|
||||
if (! this.$store.state.company.selected_company.corporate_prices) return []
|
||||
return this.$store.state.company.selected_company.corporate_prices
|
||||
},
|
||||
|
||||
companies() {
|
||||
return this.$store.state.company.companies
|
||||
},
|
||||
is_loading() {
|
||||
return this.$store.state.company.search_status == 1
|
||||
},
|
||||
|
||||
selected_mou_note() {
|
||||
let x = this.selected_mou
|
||||
if (!x)
|
||||
return []
|
||||
if (!x.note)
|
||||
return []
|
||||
|
||||
return x.note.split(/\n/)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getMouDate(item) {
|
||||
return item.corporate_price_start_date + ' s/d ' + item.corporate_price_end_date
|
||||
},
|
||||
getMou(item) {
|
||||
if (!item) return ''
|
||||
if (!item.corporate_prices) return ''
|
||||
let s_mou = ''
|
||||
item.corporate_prices.forEach( function(price,idx) {
|
||||
if (s_mou!='') s_mou += ', '
|
||||
s_mou += price.price_header_name
|
||||
});
|
||||
return s_mou
|
||||
},
|
||||
thr_search: _.debounce( function () {
|
||||
this.$store.dispatch("company/search")
|
||||
}, 200),
|
||||
thr_search_project: _.debounce( function () {
|
||||
this.$store.dispatch("company/search_project",{search:this.search_project})
|
||||
}, 200),
|
||||
thr_search_fisik_template: _.debounce( function () {
|
||||
this.$store.dispatch("company/search_fisik_template",{search:this.search_fisik_template})
|
||||
}, 200)
|
||||
},
|
||||
watch: {
|
||||
search(val,old) {
|
||||
if (this.$store.state.order.is_from_clinic)
|
||||
return
|
||||
if (val == null || typeof val == 'undefined') val = ""
|
||||
if (val == old ) return
|
||||
if (this.$store.state.company.search_status == 1 ) return
|
||||
this.$store.commit("company/update_search",val)
|
||||
this.thr_search()
|
||||
},
|
||||
search_project(val,old) {
|
||||
if (this.$store.state.order.is_from_clinic)
|
||||
return
|
||||
if (val == null || typeof val == 'undefined') val = ""
|
||||
if (val == old ) return
|
||||
if (this.$store.state.company.is_loading_project == true ) return
|
||||
this.thr_search_project()
|
||||
}
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
search_project: '',
|
||||
search_fisik_template: ''
|
||||
// search : ''
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('company/search_fisik_template',{search:''})
|
||||
// this.$store.dispatch('company/search_default')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<v-layout column pb-2>
|
||||
<v-card class="pa-1 mb-0" >
|
||||
<v-layout align-center row>
|
||||
<v-flex xs12>
|
||||
<v-card tile class="pa-2" flat color="#64b2cd">
|
||||
<h5 style="color:#fff" class="subtitle-1 font-weight-bold">KEL. PELANGGAN DAN AGREEMENT</h5>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex pt-1 pl-2 pr-1 xs6>
|
||||
<v-autocomplete
|
||||
label="Kel. Pelanggan"
|
||||
v-model="selected_company"
|
||||
:items="companies"
|
||||
style="font-size:12px;"
|
||||
:search-input.sync="search"
|
||||
:readonly="isHavingTest"
|
||||
auto-select-first
|
||||
no-filter
|
||||
hide-details
|
||||
return-object
|
||||
:clearable="! isHavingTest"
|
||||
item-text="M_CompanyName"
|
||||
:loading="is_loading"
|
||||
no-data-text="Pilih Company"
|
||||
>
|
||||
<template
|
||||
slot="item"
|
||||
slot-scope="{ item }"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CompanyName"></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-flex>
|
||||
<v-flex pt-1 pl-1 pr-2 xs6>
|
||||
<v-select
|
||||
v-model="selected_mou"
|
||||
:items="company_mou"
|
||||
:readonly="isHavingTest"
|
||||
style="font-size:12px;"
|
||||
auto-select-first
|
||||
item-text = "M_MouName"
|
||||
return-object
|
||||
label="Agreement"
|
||||
hide-details
|
||||
class="mb-1"
|
||||
>
|
||||
<template
|
||||
slot="item"
|
||||
slot-scope="{ item }"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_MouName"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-text="getMouDate(item)"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-select>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout v-if="selected_mou_note.length > 0" mt-1 pt-1 pl-2 pr-2 style="border:1px dashed #64b2cd" row>
|
||||
<v-flex xs12>
|
||||
<p class="mb-1"><kbd style="background:#ec4d4d">Catatan :</kbd></p>
|
||||
<p v-for="(note, n) in selected_mou_note" v-bind:key="n" class="mb-1 caption">{{ note }}</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout v-if="show_doctor_alert" mt-1 pt-1 pl-2 pr-2 row>
|
||||
<v-flex xs12>
|
||||
<p style="background:#ee7777;color:#fff" class="caption pl-2 pr-2 pt-1 pb-1 mb-1">Dokter belum dipilih, jangan lupa ya</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
computed: {
|
||||
show_doctor_alert(){
|
||||
return this.$store.state.doctor.show_doctor_alert
|
||||
},
|
||||
search:{
|
||||
get(){
|
||||
return this.$store.state.company.search
|
||||
},
|
||||
set(val) {
|
||||
if (val == null) return
|
||||
this.$store.commit('company/update_search',val)
|
||||
}
|
||||
},
|
||||
isHavingTest() {
|
||||
return this.$store.state.px.selected_test.length > 0 ||
|
||||
this.$store.state.px.selected_panel.length > 0
|
||||
},
|
||||
selected_mou: {
|
||||
get() {
|
||||
return this.$store.state.company.selected_mou
|
||||
},
|
||||
|
||||
set(val) {
|
||||
this.$store.commit("company/update_selected_mou", val)
|
||||
var doctor = this.$store.state.doctor.selected_doctor
|
||||
var company = this.$store.state.company.selected_company
|
||||
var alias_doctor = this.$store.state.doctor.doctor_alias
|
||||
if(doctor){
|
||||
if(doctor.M_DoctorName.trim() === '-' && alias_doctor === '' && company.M_CompanyName !== 'PASIEN MANDIRI'){
|
||||
this.$store.commit('doctor/update_show_doctor_alert', true)
|
||||
}
|
||||
else{
|
||||
this.$store.commit('doctor/update_show_doctor_alert', false)
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.$store.commit('doctor/update_show_doctor_alert', true)
|
||||
}
|
||||
// Auto CHECKED
|
||||
let dlv = this.$store.state.delivery.checked_id
|
||||
let cmou = val
|
||||
|
||||
this.$store.dispatch('delivery/search_deliveries',{type:'mou',id:val.M_MouID})
|
||||
|
||||
// Search Test
|
||||
this.$store.dispatch('px/search')
|
||||
}
|
||||
},
|
||||
selected_company: {
|
||||
get() {
|
||||
return this.$store.state.company.selected_company
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("company/update_selected_company", val)
|
||||
for (let i in val.mou)
|
||||
if (val.mou[i].M_MouIsDefault == 'Y'){
|
||||
this.$store.commit('company/update_selected_mou', val.mou[i])
|
||||
this.$store.dispatch('delivery/search_deliveries',{type:'mou',id:val.mou[i].M_MouID})
|
||||
console.log("mulai cari px")
|
||||
this.$store.dispatch('px/search')
|
||||
}
|
||||
var doctor = this.$store.state.doctor.selected_doctor
|
||||
var alias_doctor = this.$store.state.doctor.doctor_alias
|
||||
if(doctor){
|
||||
if(doctor.M_DoctorName.trim() === '-' && alias_doctor === '' && val.M_CompanyName !== 'PASIEN MANDIRI'){
|
||||
this.$store.commit('doctor/update_show_doctor_alert', true)
|
||||
}
|
||||
else{
|
||||
this.$store.commit('doctor/update_show_doctor_alert', false)
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.$store.commit('doctor/update_show_doctor_alert', true)
|
||||
}
|
||||
}
|
||||
},
|
||||
company_mou() {
|
||||
if (! this.$store.state.company.selected_company) return []
|
||||
if (! this.$store.state.company.selected_company.mou) return []
|
||||
return this.$store.state.company.selected_company.mou
|
||||
},
|
||||
|
||||
companies() {
|
||||
return this.$store.state.company.companies
|
||||
},
|
||||
is_loading() {
|
||||
return this.$store.state.company.search_status == 1
|
||||
},
|
||||
|
||||
selected_mou_note() {
|
||||
let x = this.selected_mou
|
||||
if (!x)
|
||||
return []
|
||||
if (!x.M_MouNote)
|
||||
return []
|
||||
|
||||
return x.M_MouNote.split(/\n/)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getMouDate(item) {
|
||||
return item.M_MouStartDate + ' s/d ' + item.M_MouEndDate
|
||||
},
|
||||
getMou(item) {
|
||||
if (!item) return ''
|
||||
if (!item.mou) return ''
|
||||
let s_mou = ''
|
||||
item.mou.forEach( function(mou,idx) {
|
||||
if (s_mou!='') s_mou += ', '
|
||||
s_mou += mou.M_MouName
|
||||
});
|
||||
return s_mou
|
||||
},
|
||||
thr_search: _.debounce( function () {
|
||||
this.$store.dispatch("company/search")
|
||||
}, 700)
|
||||
},
|
||||
watch: {
|
||||
search(val,old) {
|
||||
if (this.$store.state.order.is_from_clinic)
|
||||
return
|
||||
if (val == null || typeof val == 'undefined') val = ""
|
||||
if (val == old ) return
|
||||
if (this.$store.state.company.search_status == 1 ) return
|
||||
this.$store.commit("company/update_search",val)
|
||||
this.thr_search()
|
||||
}
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
// search : ''
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('company/search_default')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,341 @@
|
||||
<template>
|
||||
<v-layout column pb-2>
|
||||
<!--<one-fo-registration-patient-order></one-fo-registration-patient-order>-->
|
||||
<v-flex xs12>
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">No Reg</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ selected_order.order_no }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Tangal Periksa</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ selected_order.order_date }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">PID</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ selected_order.patient_mr }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Nama Pasien</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ selected_order.patient_name }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Kel. Pelanggan</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ selected_order.order_company }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Agreement</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ selected_order.order_mou }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row mb-2>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Pengirim</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ selected_order.doctor_sender }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Alamat Pengirim</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ selected_order.doctor_sender_address }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
<v-layout row mb-2 wrap>
|
||||
<v-flex v-for="(dlv, n) in order_delivery" xs6 v-bind:key="n">
|
||||
<v-layout row wrap pl-2>
|
||||
<v-flex xs12 class="text-delivery text-xs-right">
|
||||
<p class="mb-1">{{ dlv.label }} : {{ dlv.description }}</p>
|
||||
<p class="mb-1 mono red--text caption">catatan : <span v-if="dlv.note === ''">-</span> <span v-if="dlv.note !== ''">{{ dlv.note }}</span></p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row mb-2 wrap>
|
||||
<v-flex xs12>
|
||||
<v-layout row wrap pl-2>
|
||||
<v-flex xs12>
|
||||
<div class="font-weight-bold text-fajrihm">Janji Hasil</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row wrap pl-2>
|
||||
<v-flex xs12 v-for="p in promises" >
|
||||
<div class="font-weight-bold text-fajrihm">{{ p.T_OrderPromiseDateTime_ina }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
<v-layout row pa-2>
|
||||
<v-flex xs12>
|
||||
|
||||
<table>
|
||||
<tr style="background:#ffeaa5">
|
||||
|
||||
<th style="width:42%;font-weight:bold;font-size:12px;" class="text-md-center pt-2 pb-2">PEMERIKSAAN</th>
|
||||
<th style="width:12%;font-weight:bold;font-size:12px;" class="text-md-center pt-2 pb-2">BRUTO</th>
|
||||
<th style="width:12%;font-weight:bold;font-size:12px;" class="text-md-center pt-2 pb-2">DISKON</th>
|
||||
<th style="width:12%;font-weight:bold;font-size:12px;" class="text-md-center pt-2 pb-2">TOTAL</th>
|
||||
</tr>
|
||||
|
||||
<tr style="font-size:12px" v-for="t in selected_test" v-bind:key="t.T_OrderDetailID">
|
||||
|
||||
<td class="text-md-left pl-3">
|
||||
<p class="mb-1">{{ t.T_OrderDetailT_TestName}}</p>
|
||||
<!----<p class="mb-0 caption" v-show="child_test_show(t)">{{child_test(t.child_test)}}</p>-->
|
||||
</td>
|
||||
<td class="text-md-right mono pr-2">{{ one_money(t.T_OrderDetailPrice) }}</td>
|
||||
<td class="text-md-right mono pr-2">{{ one_money(t.T_OrderDetailDiscTotal) }}</td>
|
||||
<td class="text-md-right mono font-weight-black pr-2">{{ one_money(t.T_OrderDetailTotal) }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<!--/ TEST PANEL -->
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="background:#e16262;color:#fff" class="text-md-left pl-3 pt-2 pb-2">TOTAL</th>
|
||||
<th style="background:#e16262;color:#fff" class="text-md-right pr-2 pt-2 pb-2">{{ one_money(bruto_total) }}</th>
|
||||
<th style="background:#e16262;color:#fff" class="text-md-right pr-2 pt-2 pb-2">{{ one_money(diskon_total) }}</th>
|
||||
<th style="background:#e16262;color:#fff" class="text-md-right pr-2 pt-2 pb-2" >{{ one_money(sub_total) }}</th>
|
||||
</tr>
|
||||
|
||||
</tfoot>
|
||||
</table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-2 mb-2></v-layout>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.v-input--selection-controls {
|
||||
margin-top: 0px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
.text-fajrihm{
|
||||
padding: 3px 20px 3px 0;
|
||||
text-align:left;
|
||||
font-size: 13px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
}
|
||||
|
||||
.label-delivery{
|
||||
font-size: 11px;
|
||||
padding: 3px 20px 3px 0;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
}
|
||||
.text-delivery{
|
||||
font-size: 12px;
|
||||
padding: 3px 20px 3px 0;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
}
|
||||
|
||||
.nota {
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
.total {
|
||||
min-height:76px;
|
||||
}
|
||||
table {
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
background:white;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
table>tr>td {
|
||||
padding: 8px;
|
||||
}
|
||||
table>tr>td:first {
|
||||
padding-left:15px!important;
|
||||
}
|
||||
.nota {
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
.total {
|
||||
min-height:76px;
|
||||
}
|
||||
table {
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
background:white;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
table>tr>td {
|
||||
padding: 8px;
|
||||
}
|
||||
table>tr>td:first {
|
||||
padding-left:15px!important;
|
||||
}
|
||||
|
||||
.vintage-text{
|
||||
text-shadow: 0px -2px 0px #fff, 0px 2px 3px #fff;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
computed: {
|
||||
|
||||
promises() {
|
||||
return this.$store.state.payment.promises
|
||||
},
|
||||
selected_order() {
|
||||
return this.$store.state.patient.selected_patient
|
||||
},
|
||||
order_delivery() {
|
||||
var dlvr = this.$store.state.payment.order_delivery
|
||||
|
||||
return dlvr
|
||||
},
|
||||
selected_test() {
|
||||
return this.$store.state.payment.order_detail
|
||||
},
|
||||
selected_panel() {
|
||||
return this.$store.state.px.selected_panel
|
||||
},
|
||||
discount_pembulatan() {
|
||||
//sipe : set to 0
|
||||
return 0
|
||||
},
|
||||
grand_total() {
|
||||
|
||||
return this.sub_total
|
||||
},
|
||||
sub_total() {
|
||||
let tests = this.selected_test
|
||||
sub_total = 0
|
||||
tests.forEach(function(t,idx) {
|
||||
let price = parseInt(t.T_OrderDetailTotal)
|
||||
sub_total += price
|
||||
})
|
||||
|
||||
return sub_total
|
||||
},
|
||||
bruto_total() {
|
||||
let tests = this.selected_test
|
||||
bruto_total = 0
|
||||
tests.forEach(function(t,idx) {
|
||||
//console.log(t.T_PriceAmount)
|
||||
bruto_total += parseInt(t.T_OrderDetailPrice)
|
||||
//console.log(bruto_total)
|
||||
})
|
||||
|
||||
return bruto_total
|
||||
},
|
||||
diskon_total() {
|
||||
let tests = this.selected_test
|
||||
diskon_total = 0
|
||||
tests.forEach(function(t,idx) {
|
||||
let price = parseInt(t.T_OrderDetailDiscTotal)
|
||||
diskon_total += price
|
||||
})
|
||||
|
||||
return diskon_total
|
||||
},
|
||||
|
||||
},
|
||||
methods : {
|
||||
one_money(p) {
|
||||
return window.one_money(p)
|
||||
},
|
||||
child_test(x) {
|
||||
let y = []
|
||||
for (let i in x)
|
||||
y.push(x[i].T_TestName)
|
||||
return y.join(', ')
|
||||
},
|
||||
child_test_show(t) {
|
||||
if (!t.child_test)
|
||||
return false
|
||||
|
||||
if (t.child_test.length < 1)
|
||||
return false
|
||||
|
||||
if (t.px_type != 'PN')
|
||||
return false
|
||||
|
||||
return true
|
||||
},
|
||||
calc_netto(t) {
|
||||
return one_float(t.T_PriceAmount) - one_float(t.T_PriceDisc) / 100 * one_float(t.T_PriceAmount)
|
||||
- one_float(t.T_PriceDiscRp)
|
||||
},
|
||||
|
||||
calc_discount(t) {
|
||||
return ( one_float(t.T_PriceDisc) / 100 * one_float(t.T_PriceAmount) )
|
||||
+ one_float(t.T_PriceDiscRp)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,361 @@
|
||||
<template>
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
persistent
|
||||
width="800px"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs6 pr-2>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pl-1 pr-1>
|
||||
<v-text-field
|
||||
label="NAMA LENGKAP"
|
||||
v-model="name"
|
||||
:error="!rules.required"
|
||||
:rules="[rules.required]"
|
||||
@update:error="error_trigger('name', $event)"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pl-1 pr-1>
|
||||
<v-text-field
|
||||
label="Prefix 1"
|
||||
v-model="prefix1"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pl-1 pr-1>
|
||||
<v-text-field
|
||||
label="Prefix 2"
|
||||
v-model="prefix2"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex xs4 pl-1 pr-1>
|
||||
<v-text-field
|
||||
label="Sufix 1"
|
||||
v-model="sufix1"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs4 pl-1 pr-1>
|
||||
<v-text-field
|
||||
label="Sufix 2"
|
||||
v-model="sufix2"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs4 pl-1 pr-1>
|
||||
<v-text-field
|
||||
label="Sufix 3"
|
||||
v-model="sufix3"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex xs6 pl-1 pr-1>
|
||||
<v-select
|
||||
:items="sexs"
|
||||
item-text="M_SexName"
|
||||
item-value="M_SexID"
|
||||
return-object
|
||||
v-model="selected_sex"
|
||||
label="Jenis Kelamin"
|
||||
:error="!rules.required"
|
||||
:rules="[rules.required]"
|
||||
@update:error="error_trigger('selected_sex', $event)"
|
||||
></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs6>
|
||||
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 pl-1 pr-1>
|
||||
<v-text-field
|
||||
label="No HP"
|
||||
v-model="hp"
|
||||
:error="!rules.required"
|
||||
:rules="[rules.required]"
|
||||
@update:error="error_trigger('hp', $event)"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 pl-1 pr-1>
|
||||
<v-text-field
|
||||
label="Catatan"
|
||||
v-model="note"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs6 pl-2>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-textarea label="Alamat lengkap" v-model="address"
|
||||
:error="!rules.required"
|
||||
:rules="[rules.required]"
|
||||
@update:error="error_trigger('address', $event)"></v-textarea>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
|
||||
<v-autocomplete
|
||||
:items="provinces"
|
||||
item-text="M_ProvinceName"
|
||||
item-value="M_ProvinceID"
|
||||
return-object
|
||||
v-model="selected_province"
|
||||
label="Propinsi"
|
||||
autocomplete
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-autocomplete
|
||||
:items="cities"
|
||||
item-text="M_CityName"
|
||||
item-value="M_CityID"
|
||||
return-object
|
||||
v-model="selected_city"
|
||||
label="Kota"
|
||||
autocomplete
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-autocomplete
|
||||
:items="districts"
|
||||
item-text="M_DistrictName"
|
||||
item-value="M_DictrictID"
|
||||
return-object
|
||||
v-model="selected_district"
|
||||
label="Kecamatan"
|
||||
autocomplete
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12>
|
||||
<v-autocomplete
|
||||
:items="villages"
|
||||
item-text="M_KelurahanName"
|
||||
item-value="M_KelurahanID"
|
||||
return-object
|
||||
v-model="selected_village"
|
||||
label="Kelurahan"
|
||||
autocomplete
|
||||
:error="!rules.required"
|
||||
:rules="[rules.required]"
|
||||
@update:error="error_trigger('selected_village', $event)"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
<v-card-actions>
|
||||
<v-btn color="primary" flat @click="dialog=!dialog">Tutup</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" @click="save" :disabled="!btn_save_enabled" >Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data () {
|
||||
return {
|
||||
errors : {
|
||||
name : true,
|
||||
hp : true,
|
||||
sufix1 : false,
|
||||
sufix2 : false,
|
||||
sufix3 : false,
|
||||
prefix1 : false,
|
||||
prefix2 : false,
|
||||
selected_sex : true,
|
||||
address : false,
|
||||
selected_village : false
|
||||
},
|
||||
rules : {
|
||||
required : value => { return !!value || "Harus diisi !" },
|
||||
// hp : value => { this.errors.name = !value; return !!value || "Harus diisi !" },
|
||||
// selected_sex : value => { this.errors.name = !value; return !!value || "Harus diisi !" },
|
||||
// address : value => { this.errors.name = !value; return !!value || "Harus diisi !" },
|
||||
// selected_village : value => { this.errors.name = !value; return !!value || "Harus diisi !" }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
dialog : {
|
||||
get () { return this.$store.state.doctor_new.dialog_new },
|
||||
set (v) { this.$store.commit('doctor_new/update_dialog_new') }
|
||||
},
|
||||
|
||||
sexs () {
|
||||
return this.$store.state.doctor_new.sexs
|
||||
},
|
||||
|
||||
selected_sex : {
|
||||
get () { return this.$store.state.doctor_new.selected_sex },
|
||||
set (v) { this.$store.commit('doctor_new/update_selected_sex', v) }
|
||||
},
|
||||
|
||||
provinces () {
|
||||
return this.$store.state.doctor_new.provinces
|
||||
},
|
||||
|
||||
selected_province : {
|
||||
get () { return this.$store.state.doctor_new.selected_province },
|
||||
set (v) {
|
||||
this.$store.commit('doctor_new/update_selected_province', v)
|
||||
// this.$store.dispatch('doctor_new/search_city')
|
||||
}
|
||||
},
|
||||
|
||||
cities () {
|
||||
return this.$store.state.doctor_new.cities
|
||||
},
|
||||
|
||||
selected_city : {
|
||||
get () { return this.$store.state.doctor_new.selected_city },
|
||||
set (v) {
|
||||
this.$store.commit('doctor_new/update_selected_city', v)
|
||||
// this.$store.dispatch('doctor_new/search_district')
|
||||
}
|
||||
},
|
||||
|
||||
districts () {
|
||||
return this.$store.state.doctor_new.districts
|
||||
},
|
||||
|
||||
selected_district : {
|
||||
get () { return this.$store.state.doctor_new.selected_district },
|
||||
set (v) {
|
||||
this.$store.commit('doctor_new/update_selected_district', v)
|
||||
// this.$store.dispatch('doctor_new/search_village')
|
||||
}
|
||||
},
|
||||
|
||||
villages () {
|
||||
return this.$store.state.doctor_new.villages
|
||||
},
|
||||
|
||||
selected_village : {
|
||||
get () { return this.$store.state.doctor_new.selected_village },
|
||||
set (v) { this.$store.commit('doctor_new/update_selected_village', v) }
|
||||
},
|
||||
|
||||
name : {
|
||||
get () { return this.$store.state.doctor_new.param_name },
|
||||
set (v) { this.$store.commit('doctor_new/update_param', {param:'name',val:v}) }
|
||||
},
|
||||
|
||||
prefix1 : {
|
||||
get () { return this.$store.state.doctor_new.param_prefix1 },
|
||||
set (v) { this.$store.commit('doctor_new/update_param', {param:'prefix1',val:v}) }
|
||||
},
|
||||
|
||||
prefix2 : {
|
||||
get () { return this.$store.state.doctor_new.param_prefix2 },
|
||||
set (v) { this.$store.commit('doctor_new/update_param', {param:'prefix2',val:v}) }
|
||||
},
|
||||
|
||||
sufix1 : {
|
||||
get () { return this.$store.state.doctor_new.param_sufix1 },
|
||||
set (v) { this.$store.commit('doctor_new/update_param', {param:'sufix1',val:v}) }
|
||||
},
|
||||
|
||||
sufix2 : {
|
||||
get () { return this.$store.state.doctor_new.param_sufix2 },
|
||||
set (v) { this.$store.commit('doctor_new/update_param', {param:'sufix2',val:v}) }
|
||||
},
|
||||
|
||||
sufix3 : {
|
||||
get () { return this.$store.state.doctor_new.param_sufix3 },
|
||||
set (v) { this.$store.commit('doctor_new/update_param', {param:'sufix3',val:v}) }
|
||||
},
|
||||
|
||||
hp : {
|
||||
get () { return this.$store.state.doctor_new.param_hp },
|
||||
set (v) { this.$store.commit('doctor_new/update_param', {param:'hp',val:v}) }
|
||||
},
|
||||
|
||||
note : {
|
||||
get () { return this.$store.state.doctor_new.param_note },
|
||||
set (v) { this.$store.commit('doctor_new/update_param', {param:'note',val:v}) }
|
||||
},
|
||||
|
||||
address : {
|
||||
get () { return this.$store.state.doctor_new.param_address },
|
||||
set (v) { this.$store.commit('doctor_new/update_param', {param:'address',val:v}) }
|
||||
},
|
||||
|
||||
btn_save_enabled () {
|
||||
if (this.errors.name || this.errors.hp || this.errors.selected_sex || this.errors.address ||
|
||||
this.errors.selected_village)
|
||||
return false
|
||||
|
||||
return true
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
save () {
|
||||
this.$store.commit('update_dialog_loading', true)
|
||||
this.$store.dispatch('doctor_new/save')
|
||||
},
|
||||
|
||||
error_trigger(x, e) {
|
||||
this.errors[x] = e
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('doctor_new/search_sex')
|
||||
},
|
||||
|
||||
watch : {
|
||||
dialog(val, old) {
|
||||
if (val && !old) {
|
||||
this.$store.dispatch('doctor_new/search_province')
|
||||
|
||||
this.name = ""
|
||||
this.hp = ""
|
||||
this.sufix1 = ""
|
||||
this.sufix2 = ""
|
||||
this.sufix3 = ""
|
||||
this.prefix1 = ""
|
||||
this.prefix2 = ""
|
||||
this.selected_sex = null
|
||||
this.address = ""
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
selected_province(val, old) {
|
||||
if (val != old)
|
||||
this.$store.dispatch('doctor_new/search_city')
|
||||
},
|
||||
|
||||
selected_city(val, old) {
|
||||
if (val != old)
|
||||
this.$store.dispatch('doctor_new/search_district')
|
||||
},
|
||||
|
||||
selected_district(val, old) {
|
||||
if (val != old)
|
||||
this.$store.dispatch('doctor_new/search_village')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<div class="text-center ma-2">
|
||||
<v-snackbar
|
||||
v-model="snackbar"
|
||||
>
|
||||
{{ text }}
|
||||
<v-btn
|
||||
color="red"
|
||||
text
|
||||
@click="snackbar = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-snackbar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
snackbar: false,
|
||||
text: 'Ups ! Nampaknya anda harus login kembali',
|
||||
}),
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
max-width="500px"
|
||||
transition="dialog-transition"
|
||||
|
||||
>
|
||||
<v-card>
|
||||
<v-card-text>
|
||||
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
@@ -0,0 +1,443 @@
|
||||
<template>
|
||||
<v-layout column pb-2>
|
||||
<v-card >
|
||||
<v-layout row>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">No Reg</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ order_no }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Tangal Periksa</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ order_date }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">PID</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ patient_mr }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Nama Pasien</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ patient_name }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Kel. Pelanggan</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ order_company }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Agreement</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ order_mou }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row mb-2>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Pengirim</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ doctor_sender }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex md6>
|
||||
<v-layout row pl-2>
|
||||
<v-flex md5>
|
||||
<div class="font-weight-bold text-fajrihm">Alamat Pengirim</div>
|
||||
</v-flex>
|
||||
<v-flex md7>
|
||||
<div class="font-weight-regular text-fajrihm text-md-right">{{ doctor_sender_address }}</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
<v-layout row mb-2 wrap>
|
||||
<v-flex v-for="(dlv, n) in order_delivery" xs6 v-bind:key="n">
|
||||
<v-layout row wrap pl-2>
|
||||
<v-flex xs4 class="label-delivery font-weight-bold">
|
||||
{{ dlv.delivery_name }}
|
||||
</v-flex>
|
||||
<v-flex xs8 class="text-delivery text-xs-right">
|
||||
<p class="mb-1">{{ dlv.description }}</p>
|
||||
<p class="mb-1 mono red--text caption">catatan : <span v-if="dlv.note === ''">-</span> <span v-if="dlv.note !== ''">{{ dlv.note }}</span></p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
<v-layout row pa-2>
|
||||
<v-flex xs12>
|
||||
|
||||
<table>
|
||||
<tr style="background:#ffeaa5">
|
||||
|
||||
<th style="width:42%;font-weight:bold;font-size:12px;" class="text-md-center pt-2 pb-2">PEMERIKSAAN</th>
|
||||
<th style="width:12%;font-weight:bold;font-size:12px;" class="text-md-center pt-2 pb-2">BRUTO</th>
|
||||
<th style="width:12%;font-weight:bold;font-size:12px;" class="text-md-center pt-2 pb-2">DISKON</th>
|
||||
<th style="width:12%;font-weight:bold;font-size:12px;" class="text-md-center pt-2 pb-2">TOTAL</th>
|
||||
</tr>
|
||||
|
||||
<tr style="font-size:12px" v-for="t in selected_test" v-bind:key="t.T_TestID">
|
||||
|
||||
<td class="text-md-left pl-3">
|
||||
<p class="mb-1">{{ t.T_TestName}}</p>
|
||||
<p class="mb-0 caption" v-show="child_test_show(t)">{{child_test(t.child_test)}}</p>
|
||||
</td>
|
||||
<td class="text-md-right mono pr-2">{{ one_money(t.T_PriceAmount) }}</td>
|
||||
<td class="text-md-right mono pr-2">{{ one_money(calc_discount(t)) }}</td>
|
||||
<td class="text-md-right mono font-weight-black pr-2">{{ one_money(calc_netto(t)) }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<!-- TEST PANEL -->
|
||||
<template v-for="p in selected_panel">
|
||||
<tr class="tr-panel">
|
||||
<td class="text-md-center">
|
||||
<v-icon color="red" @click="deletePanel(p)">delete</v-icon>
|
||||
</td>
|
||||
<td class="text-md-left pl-3 pr-2" colspan="4">{{ p.T_TestPanelName}}</td>
|
||||
</tr>
|
||||
<tr v-for="t in p.test" v-bind:key="t.T_TestID">
|
||||
<td class="text-md-center">
|
||||
|
||||
</td>
|
||||
<td class="text-md-left pl-3">{{ t.T_TestName}}</td>
|
||||
<td class="text-md-right pr-2">{{ one_money(t.T_PriceAmount) }}</td>
|
||||
<td class="text-md-right pr-2">{{ one_money(calc_discount(t)) }}</td>
|
||||
<td class="text-md-right pr-2">{{ one_money(calc_netto(t)) }}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<!--/ TEST PANEL -->
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="background:#e16262;color:#fff" class="text-md-left pl-3 pt-2 pb-2">TOTAL</th>
|
||||
<th style="background:#e16262;color:#fff" class="text-md-right pr-2 pt-2 pb-2">{{ one_money(bruto_total) }}</th>
|
||||
<th style="background:#e16262;color:#fff" class="text-md-right pr-2 pt-2 pb-2">{{ one_money(diskon_total) }}</th>
|
||||
<th style="background:#e16262;color:#fff" class="text-md-right pr-2 pt-2 pb-2" >{{ one_money(sub_total) }}</th>
|
||||
</tr>
|
||||
|
||||
</tfoot>
|
||||
</table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-2 mb-2></v-layout>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.v-input--selection-controls {
|
||||
margin-top: 0px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
.text-fajrihm{
|
||||
padding: 3px 20px 3px 0;
|
||||
text-align:left;
|
||||
font-size: 13px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
}
|
||||
|
||||
.label-delivery{
|
||||
font-size: 11px;
|
||||
padding: 3px 20px 3px 0;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
}
|
||||
.text-delivery{
|
||||
font-size: 12px;
|
||||
padding: 3px 20px 3px 0;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
}
|
||||
|
||||
.nota {
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
.total {
|
||||
min-height:76px;
|
||||
}
|
||||
table {
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
background:white;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
table>tr>td {
|
||||
padding: 8px;
|
||||
}
|
||||
table>tr>td:first {
|
||||
padding-left:15px!important;
|
||||
}
|
||||
.nota {
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
.total {
|
||||
min-height:76px;
|
||||
}
|
||||
table {
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
background:white;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
table>tr>td {
|
||||
padding: 8px;
|
||||
}
|
||||
table>tr>td:first {
|
||||
padding-left:15px!important;
|
||||
}
|
||||
|
||||
.vintage-text{
|
||||
text-shadow: 0px -2px 0px #fff, 0px 2px 3px #fff;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
methods : {
|
||||
one_money(p) {
|
||||
return window.one_money(p)
|
||||
},
|
||||
child_test(x) {
|
||||
let y = []
|
||||
for (let i in x)
|
||||
y.push(x[i].T_TestName)
|
||||
return y.join(', ')
|
||||
},
|
||||
|
||||
child_test_show(t) {
|
||||
if (!t.child_test)
|
||||
return false
|
||||
|
||||
if (t.child_test.length < 1)
|
||||
return false
|
||||
|
||||
if (t.px_type != 'PN')
|
||||
return false
|
||||
|
||||
return true
|
||||
},
|
||||
calc_netto(t) {
|
||||
return one_float(t.T_PriceAmount) - one_float(t.T_PriceDisc) / 100 * one_float(t.T_PriceAmount)
|
||||
- one_float(t.T_PriceDiscRp)
|
||||
},
|
||||
|
||||
calc_discount(t) {
|
||||
return ( one_float(t.T_PriceDisc) / 100 * one_float(t.T_PriceAmount) )
|
||||
+ one_float(t.T_PriceDiscRp)
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
selected_patient() {
|
||||
return this.$store.state.patient.selected_patient
|
||||
},
|
||||
selected_panel() {
|
||||
return this.$store.state.px.selected_panel
|
||||
},
|
||||
selected_test() {
|
||||
return this.$store.state.px.selected_test
|
||||
},
|
||||
discount_pembulatan() {
|
||||
//sipe : set to 0
|
||||
return 0
|
||||
let st = this.sub_total
|
||||
let part = st%1000
|
||||
if (part > 500) return part - 500
|
||||
if (part < 500 && part > 0 ) return part
|
||||
return 0
|
||||
},
|
||||
grand_total() {
|
||||
let gt = this.sub_total - this.discount_pembulatan
|
||||
return gt
|
||||
},
|
||||
sub_total() {
|
||||
let tests = this.selected_test
|
||||
sub_total = 0
|
||||
tests.forEach(function(t,idx) {
|
||||
let price = t.T_PriceAmount - t.T_PriceDisc / 100 * t.T_PriceAmount
|
||||
- t.T_PriceDiscRp
|
||||
sub_total += price
|
||||
})
|
||||
let panels = this.selected_panel
|
||||
panels.forEach(function(p) {
|
||||
let tests = p.test
|
||||
tests.forEach(function(t,idx) {
|
||||
let price = t.T_PriceAmount - t.T_PriceDisc / 100 * t.T_PriceAmount
|
||||
- t.T_PriceDiscRp
|
||||
sub_total += price
|
||||
})
|
||||
|
||||
})
|
||||
return sub_total
|
||||
},
|
||||
bruto_total() {
|
||||
let tests = this.selected_test
|
||||
bruto_total = 0
|
||||
tests.forEach(function(t,idx) {
|
||||
//console.log(t.T_PriceAmount)
|
||||
bruto_total += parseInt(t.T_PriceAmount)
|
||||
//console.log(bruto_total)
|
||||
})
|
||||
let panels = this.selected_panel
|
||||
panels.forEach(function(p) {
|
||||
let tests = p.test
|
||||
tests.forEach(function(t,idx) {
|
||||
bruto_total += parseInt(t.T_PriceAmount)
|
||||
})
|
||||
|
||||
})
|
||||
return bruto_total
|
||||
},
|
||||
diskon_total() {
|
||||
let tests = this.selected_test
|
||||
diskon_total = 0
|
||||
tests.forEach(function(t,idx) {
|
||||
let price = parseInt(t.T_PriceDisc) / 100 * parseInt(t.T_PriceAmount) + parseInt(t.T_PriceDiscRp)
|
||||
diskon_total += price
|
||||
})
|
||||
let panels = this.selected_panel
|
||||
panels.forEach(function(p) {
|
||||
let tests = p.test
|
||||
tests.forEach(function(t,idx) {
|
||||
let price = parseInt(t.T_PriceDisc) / 100 * parseInt(t.T_PriceAmount) + parseInt(t.T_PriceDiscRp)
|
||||
diskon_total += price
|
||||
})
|
||||
|
||||
})
|
||||
return diskon_total
|
||||
},
|
||||
order_no() {
|
||||
return this.$store.state.payment.selected_patient.order_no
|
||||
},
|
||||
|
||||
order_date() {
|
||||
let x
|
||||
try {
|
||||
let z = this.$store.state.payment.selected_patient.order_date
|
||||
let y = z.split(' ')
|
||||
x = y[0].split('-').reverse().join('-') + ' ' + (y[1] ? y[1] : '')
|
||||
} catch (e) { x = '-' }
|
||||
|
||||
return x
|
||||
},
|
||||
|
||||
order_mou() {
|
||||
return this.$store.state.payment.selected_patient.order_mou
|
||||
},
|
||||
|
||||
order_company() {
|
||||
return this.$store.state.payment.selected_patient.order_company
|
||||
},
|
||||
|
||||
patient_name() {
|
||||
return this.$store.state.payment.selected_patient.patient_name
|
||||
},
|
||||
|
||||
patient_mr() {
|
||||
return this.$store.state.payment.selected_patient.patient_mr
|
||||
},
|
||||
|
||||
doctor_sender() {
|
||||
var xdoctor = this.$store.state.payment.selected_patient.doctor_sender
|
||||
if(this.$store.state.doctor.doctor_alias != '')
|
||||
xdoctor = this.$store.state.doctor.doctor_alias
|
||||
|
||||
return xdoctor
|
||||
},
|
||||
|
||||
doctor_sender_address() {
|
||||
var xaddress = this.$store.state.payment.selected_patient.doctor_sender_address
|
||||
if(this.$store.state.doctor.doctor_alias_address != '')
|
||||
xaddress = this.$store.state.doctor.doctor_alias_address
|
||||
return xaddress
|
||||
},
|
||||
|
||||
doctor_pj() {
|
||||
return this.$store.state.payment.selected_patient.doctor_pj
|
||||
},
|
||||
|
||||
order_detail() {
|
||||
return this.$store.state.payment.order_detail
|
||||
},
|
||||
|
||||
order_subtotal() {
|
||||
return this.$store.state.payment.order_subtotal
|
||||
},
|
||||
|
||||
order_rounding() {
|
||||
return this.$store.state.payment.order_rounding
|
||||
},
|
||||
|
||||
order_total() {
|
||||
return this.$store.state.payment.order_total
|
||||
},
|
||||
|
||||
order_delivery() {
|
||||
var dlvr = this.$store.state.delivery.data_deliveries
|
||||
|
||||
return _.filter(dlvr, function(o) { return o.chex === 'Y' })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,442 @@
|
||||
<template>
|
||||
<v-layout column pb-2>
|
||||
<v-card >
|
||||
<v-layout row pa-2 align-center wrap >
|
||||
<v-flex xs6>
|
||||
<div class="label-tagihan text-xs-left">Total Tagihan 001</div>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1 class="mt-3"></v-layout>
|
||||
|
||||
<v-layout row wrap v-show="order_company.is_bill == 'N'">
|
||||
<v-flex xs6>
|
||||
<h3 class="subheading orange--text">Minimum DP ({{ order_company.min_dp }}%)</h3>
|
||||
</v-flex>
|
||||
<v-flex xs6>
|
||||
<h3 class="subheading text-xs-right orange--text">{{ one_money(order_company.min_dp_rp) }}</h3>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap v-show="order_company.is_bill == 'Y' && order_company.on_hold == 'Y'">
|
||||
<v-flex xs12>
|
||||
<h3 class="subheading red--text">{{ order_company.on_hold_text }}</h3>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs6>
|
||||
<div class="text-tagihan text-xs-right"><kbd>{{ one_money(bill_total) }}</kbd></div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
|
||||
<v-layout column>
|
||||
<v-flex xs12 v-for="(p, pi) in payments" v-bind:key="p.payment_type_id">
|
||||
|
||||
<v-layout row pt-2 pb-1 pl-2 align-center wrap class="border-top-dashed">
|
||||
<v-flex xs12>
|
||||
<v-switch
|
||||
true-value="Y"
|
||||
false-value="N"
|
||||
v-model="payments[pi].payment_enable"
|
||||
:label="p.payment_type_name"
|
||||
@change="(v) => payment_enable(pi, v)"
|
||||
:disabled="paid"
|
||||
></v-switch>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row pa-2 align-center wrap >
|
||||
<v-flex xs2>
|
||||
<div class="sub-title pl-2">Jumlah</div>
|
||||
</v-flex>
|
||||
<v-flex xs4>
|
||||
<div class="pa-2">
|
||||
<v-text-field
|
||||
v-bind:class="[p.payment_type_code == 'CASH' ? 'input-cash' : 'input-plain', 'text-xs-right font-weight-bold']"
|
||||
v-model="payments[pi].payment_actual"
|
||||
:disabled="paid || (payments[pi].payment_enable == 'Y' ? false : true)"
|
||||
@input="(v) => update_payments(pi, 'payment_actual', v)"
|
||||
reverse
|
||||
|
||||
>
|
||||
</v-text-field>
|
||||
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs2>
|
||||
<div class="sub-title pl-2">{{ p.payment_note_label }}</div>
|
||||
</v-flex>
|
||||
<v-flex xs4>
|
||||
<div class="pa-2">
|
||||
<v-text-field
|
||||
v-show="p.payment_type_code != 'CASH'"
|
||||
class="input-plain"
|
||||
v-model="payments[pi].payment_note"
|
||||
:disabled="paid || (payments[pi].payment_enable == 'Y' ? false : true)"
|
||||
@input="(v) => update_payments(pi, 'payment_amount', v)"
|
||||
reverse
|
||||
|
||||
>
|
||||
</v-text-field>
|
||||
|
||||
<v-text-field
|
||||
v-show="p.payment_type_code == 'CASH'"
|
||||
class="input-cash"
|
||||
v-model="payments[pi].payment_change_mask"
|
||||
disabled
|
||||
reverse
|
||||
|
||||
>
|
||||
</v-text-field>
|
||||
</div>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 v-if="['CREDIT', 'DEBIT'].indexOf(p.payment_type_code) > -1">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs2>
|
||||
<div class="sub-title pl-2">Kartu</div>
|
||||
</v-flex>
|
||||
<v-flex xs4>
|
||||
<v-autocomplete
|
||||
:items="banks"
|
||||
item-text="Nat_BankName"
|
||||
item-value="Nat_BankID"
|
||||
outline
|
||||
hide-details
|
||||
height="30"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs2>
|
||||
<div class="sub-title pl-2">EDC</div>
|
||||
</v-flex>
|
||||
<v-flex xs4>
|
||||
<v-autocomplete
|
||||
:items="banks"
|
||||
item-text="Nat_BankName"
|
||||
item-value="Nat_BankID"
|
||||
outline
|
||||
hide-details
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
<!-- <v-layout row pa-2 align-center wrap >
|
||||
<div>
|
||||
<v-btn color="error" dark large @click="save" :disabled="!btn_save_enable">BAYAR</v-btn>
|
||||
</div>
|
||||
</v-layout> -->
|
||||
<v-layout row pa-2 wrap >
|
||||
|
||||
<v-flex xs9>
|
||||
<div>
|
||||
<v-btn color="error" :dark="btn_save_enable && !paid" @click="save" :disabled="!btn_save_enable || paid || savepayment" class="mr-0">SIMPAN & BAYAR</v-btn>
|
||||
|
||||
<!-- <v-btn color="primary" large @click="print_invoice" class="ml-0 mr-0">C INVOICE</v-btn>
|
||||
<v-btn color="primary" large @click="print_control" class="ml-0">C KARTU KONTROL</v-btn> -->
|
||||
<template>
|
||||
|
||||
<v-menu offset-y top>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="orange"
|
||||
dark
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon class="mr-1">print</v-icon>
|
||||
Cetak
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-tile
|
||||
v-for="(item, index) in menu_print"
|
||||
:key="index"
|
||||
@click="print_me(item.code)"
|
||||
>
|
||||
<v-list-tile-title>{{ item.title }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
|
||||
</template>
|
||||
|
||||
<v-btn color="primary" @click="reset" class="ml-0 mr-0">
|
||||
<v-icon class="mr-1">description</v-icon> BARU</v-btn>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs3>
|
||||
<div class="text-tagihan text-xs-right"><kbd>{{ one_money(payment_total) }}</kbd></div>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-fo-registration-payment-finish></one-fo-registration-payment-finish>
|
||||
<one-dialog-print></one-dialog-print>
|
||||
</v-layout>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.label-tagihan{
|
||||
text-align:left;
|
||||
font-size: 25px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
.sub-header{
|
||||
text-align:left;
|
||||
font-size: 18px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
.sub-title{
|
||||
text-align:left;
|
||||
font-size: 14px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
.text-tagihan{
|
||||
text-align:left;
|
||||
font-size: 42px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
}
|
||||
|
||||
.input-cash{
|
||||
width: 100%;
|
||||
padding: 8px 14px;
|
||||
box-sizing: border-box;
|
||||
border: 2px solid grey;
|
||||
border-radius: 4px;
|
||||
font-size: 22px;
|
||||
font-weight:700;
|
||||
text-align:right;
|
||||
}
|
||||
.input-plain{
|
||||
width: 100%;
|
||||
padding: 4px 8px;
|
||||
box-sizing: border-box;
|
||||
border: 2px solid grey;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.v-input, .v-input__slot, .v-messages{
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
min-height: 0px;
|
||||
}
|
||||
.v-input--selection-controls:not(.v-input--hide-details) .v-input__slot {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.border-top-dashed {
|
||||
border-top: 1px dashed rgb(221,221,221)
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-field-verification' : httpVueLoader('../../common/oneFieldVerificationSupply.vue'),
|
||||
'one-fo-registration-payment-finish' : httpVueLoader('./oneFoRegistrationPaymentFinish.vue'),
|
||||
'one-dialog-print' : httpVueLoader('./oneDialogPrint.vue')
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
checkbox: true,
|
||||
radioGroup: 1,
|
||||
switchCash: true,
|
||||
switchDebit: false,
|
||||
switchKredit: false,
|
||||
|
||||
switch_payment_enable: [],
|
||||
|
||||
payment_amount: [],
|
||||
menu_print: [
|
||||
{ title:"Cetak Invoice", code:"P.INV" },
|
||||
{ title:"Cetak Kartu Kontrol", code:"P.CC" }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
one_money(p) {
|
||||
return window.one_money(p)
|
||||
},
|
||||
|
||||
payment_enable (idx, v) {
|
||||
let payments = this.payments
|
||||
payments[idx]['payment_enable'] = v
|
||||
|
||||
this.$store.commit('payment/update_payments', payments)
|
||||
},
|
||||
|
||||
save() {
|
||||
this.$store.dispatch("payment/save");
|
||||
return
|
||||
},
|
||||
|
||||
update_payments (idx, type, v) {
|
||||
let payments = this.payments
|
||||
payments[idx][type] = v
|
||||
this.$store.commit('payment/update_payments', payments)
|
||||
},
|
||||
|
||||
reset () {
|
||||
location.reload()
|
||||
},
|
||||
|
||||
print_invoice () {
|
||||
this.$store.dispatch('payment/print_invoice', this.$store.state.payment.order_id)
|
||||
return
|
||||
},
|
||||
|
||||
print_control () {
|
||||
this.$store.dispatch('payment/print_control', this.$store.state.payment.order_id)
|
||||
return
|
||||
},
|
||||
|
||||
print_me (c) {
|
||||
if (c == "P.INV")
|
||||
return this.print_invoice()
|
||||
else if (c == "P.CC")
|
||||
return this.print_control()
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
bill_total() {
|
||||
return this.$store.state.payment.order_total
|
||||
},
|
||||
|
||||
payment_total () {
|
||||
return this.$store.state.payment.payment_total
|
||||
},
|
||||
|
||||
savepayment () {
|
||||
return this.$store.state.payment.savepayment
|
||||
},
|
||||
|
||||
payment_cash_amount : {
|
||||
get () {
|
||||
return this.$store.state.payment.order_total
|
||||
},
|
||||
set (v) {
|
||||
// this.$store.commit('payment/update_payment', {type:'cash',amount:v})
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
payment_debit_amount : {
|
||||
get () {
|
||||
return 0
|
||||
},
|
||||
set (v) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
payment_credit_amount : {
|
||||
get () {
|
||||
return 0
|
||||
},
|
||||
set (v) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
payments : {
|
||||
get () {
|
||||
let p = this.$store.state.payment.payments
|
||||
for (let i in p)
|
||||
p[i].payment_change_mask = window.one_money(p[i].payment_change)
|
||||
|
||||
return p
|
||||
// [{"payment_type_id":"1","payment_type_name":"Cash","payment_type_code":"CASH","payment_amount":"0","payment_note":"","payment_note_label":"Kembali","payment_enable":"N"},{"payment_type_id":"2","payment_type_name":"Debit","payment_type_code":"DEBIT","payment_amount":"0","payment_note":"","payment_note_label":"Nomor Kartu","payment_enable":"N"},{"payment_type_id":"3","payment_type_name":"Credit","payment_type_code":"CREDIT","payment_amount":"0","payment_note":"","payment_note_label":"Nomor Kartu","payment_enable":"N"},{"payment_type_id":"4","payment_type_name":"Voucher","payment_type_code":"VOUCHER","payment_amount":"0","payment_note":"","payment_note_label":"Nomor Voucher","payment_enable":"N"}]
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('payment/update_payments', v)
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
order_id : {
|
||||
get () {
|
||||
return this.$store.state.payment.order_id
|
||||
},
|
||||
|
||||
set (v) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
btn_save_enable () {
|
||||
if (this.payments.length < 1)
|
||||
return false
|
||||
|
||||
let en = false
|
||||
let sm = 0
|
||||
for (let i in this.payments) {
|
||||
if (this.payments[i].payment_enable == "Y") {
|
||||
en = true
|
||||
sm = sm + Math.round(this.payments[i].payment_amount)
|
||||
}
|
||||
}
|
||||
|
||||
if (!en) return false
|
||||
|
||||
if (this.$store.state.payment.order_id == 0 ||
|
||||
this.$store.state.payment.order_id == "0")
|
||||
return false;
|
||||
|
||||
if (sm == 0)
|
||||
return false
|
||||
|
||||
return true
|
||||
},
|
||||
|
||||
paid : {
|
||||
get () { return this.$store.state.payment.paid },
|
||||
set (v) { this.$store.commit('payment/update_paid', v) }
|
||||
},
|
||||
|
||||
order_company () {
|
||||
return this.$store.state.payment.order_company
|
||||
},
|
||||
|
||||
banks () {
|
||||
return this.$store.state.other.banks
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('payment/search')
|
||||
this.$store.dispatch('other/search_bank')
|
||||
},
|
||||
|
||||
watch : {
|
||||
switch_payment_enable (n, o) {
|
||||
if (n != o) {
|
||||
if (n.length < o.length) {
|
||||
for (let i in o)
|
||||
if (n.indexOf(o[i]) < 0)
|
||||
return
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
order_id (n, o) {
|
||||
if (n == 0 || n == "0")
|
||||
this.$store.commit("order/update_tab_enable", [2, false])
|
||||
else
|
||||
this.$store.commit("order/update_tab_enable", [2, true])
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,525 @@
|
||||
<template>
|
||||
<v-layout column pb-2>
|
||||
<v-card >
|
||||
<v-layout row pa-2 align-center wrap >
|
||||
<v-flex xs6>
|
||||
<div class="label-tagihan text-xs-left">Total Tagihan</div>
|
||||
|
||||
<v-layout row wrap v-show="selected_order.M_CompanyIsBill == 'N'">
|
||||
<v-flex xs6>
|
||||
<h3 class="subheading orange--text">Minimum DP ({{ selected_order.M_CompanyMinDP }}%)</h3>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap v-show="selected_order.M_CompanyIsBill == 'Y' && selected_order.M_CompanyIsAgingOnHold == 'Y'">
|
||||
<v-flex xs12>
|
||||
<h3 class="subheading red--text">Sedang on Hold</h3>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs6>
|
||||
<div class="text-tagihan text-xs-right"><kbd>{{ one_money(bill_total) }}</kbd></div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
|
||||
<v-layout column>
|
||||
<v-flex xs12 v-for="(p, pi) in payments" v-bind:key="p.payment_type_id">
|
||||
|
||||
<v-layout row pt-2 pb-1 pl-2 align-center wrap class="border-top-dashed">
|
||||
<v-flex xs12>
|
||||
<v-switch
|
||||
true-value="Y"
|
||||
false-value="N"
|
||||
v-model="payments[pi].payment_enable"
|
||||
:label="p.payment_type_name"
|
||||
@change="(v) => payment_enable(pi, v)"
|
||||
:disabled="paid"
|
||||
></v-switch>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row pa-2 wrap >
|
||||
|
||||
<v-flex xs4 pr-2>
|
||||
<!-- <div class="pa-2"> -->
|
||||
<v-text-field
|
||||
v-bind:class="[p.payment_type_code == 'CASH' ? 'input-cash' : 'input-plain', 'text-xs-right font-weight-bold']"
|
||||
v-model="payments[pi].payment_actual"
|
||||
:disabled="paid || (payments[pi].payment_enable == 'Y' ? false : true)"
|
||||
@input="(v) => update_payments(pi, 'payment_actual', v)"
|
||||
reverse
|
||||
label="Jumlah"
|
||||
outline
|
||||
>
|
||||
</v-text-field>
|
||||
|
||||
<!-- </div> -->
|
||||
</v-flex>
|
||||
<v-flex xs4 v-if="['CASH', 'VOUCHER'].indexOf(p.payment_type_code) > -1">
|
||||
<!-- <div class="pa-2"> -->
|
||||
<v-text-field
|
||||
v-show="p.payment_type_code == 'VOUCHER'"
|
||||
class="input-plain"
|
||||
v-model="payments[pi].payment_note"
|
||||
:disabled="paid || (payments[pi].payment_enable == 'Y' ? false : true)"
|
||||
@input="(v) => update_payments(pi, 'payment_amount', v)"
|
||||
reverse
|
||||
:label="p.payment_note_label"
|
||||
outline
|
||||
>
|
||||
</v-text-field>
|
||||
|
||||
<v-text-field
|
||||
v-show="p.payment_type_code == 'CASH'"
|
||||
class="input-cash"
|
||||
v-model="payments[pi].payment_change_mask"
|
||||
disabled
|
||||
reverse
|
||||
:label="p.payment_note_label"
|
||||
outline
|
||||
>
|
||||
</v-text-field>
|
||||
<!-- </div> -->
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs4 v-if="['CREDIT', 'DEBIT'].indexOf(p.payment_type_code) > -1" pr-2>
|
||||
<v-autocomplete
|
||||
:items="cards"
|
||||
item-text="Nat_BankName"
|
||||
item-value="Nat_BankID"
|
||||
outline
|
||||
hide-details
|
||||
height="30"
|
||||
label="Kartu"
|
||||
@change="(v) => update_payments(pi, 'payment_card_id', v)"
|
||||
v-model="init_val_card[p.payment_type_code]"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs4 v-if="['CREDIT', 'DEBIT'].indexOf(p.payment_type_code) > -1">
|
||||
<!-- <v-autocomplete
|
||||
:items="banks"
|
||||
item-text="Nat_BankName"
|
||||
item-value="Nat_BankID"
|
||||
outline
|
||||
hide-details
|
||||
height="30"
|
||||
label="EDC"
|
||||
@change="(v) => update_payments(pi, 'payment_edc_id', v)"
|
||||
v-model="init_val_edc[p.payment_type_code]"
|
||||
></v-autocomplete> X -->
|
||||
|
||||
<v-autocomplete
|
||||
:items="accounts"
|
||||
item-text="M_BankAccountNo"
|
||||
item-value="M_BankAccountID"
|
||||
outline
|
||||
hide-details
|
||||
height="30"
|
||||
label="EDC"
|
||||
@change="(v) => update_payments(pi, 'payment_account_id', v)"
|
||||
v-model="init_val_account[p.payment_type_code]"
|
||||
></v-autocomplete>
|
||||
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs4 v-if="['TRANSFER'].indexOf(p.payment_type_code) > -1" pr-2>
|
||||
<v-autocomplete
|
||||
:items="accounts"
|
||||
item-text="M_BankAccountNo"
|
||||
item-value="M_BankAccountID"
|
||||
outline
|
||||
hide-details
|
||||
height="30"
|
||||
label="No Rekening"
|
||||
@change="(v) => update_payments(pi, 'payment_account_id', v)"
|
||||
v-model="init_val_account[p.payment_type_code]"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
<!-- <v-layout row pa-2 align-center wrap >
|
||||
<div>
|
||||
<v-btn color="error" dark large @click="save" :disabled="!btn_save_enable">BAYAR</v-btn>
|
||||
</div>
|
||||
</v-layout> -->
|
||||
<v-layout row pa-2 wrap >
|
||||
|
||||
<v-flex xs9>
|
||||
<div>
|
||||
<v-btn v-show="!is_bill" color="error" :dark="btn_save_enable && !paid" @click="save" :disabled="!btn_save_enable || paid || savepayment" class="mr-0">SIMPAN & BAYAR</v-btn>
|
||||
<v-btn v-show="is_bill" color="error" dark @click="print_bukti" class="mr-0">BUKTI PEMERIKSAAN</v-btn>
|
||||
|
||||
<!-- <v-btn color="primary" large @click="print_invoice" class="ml-0 mr-0">C INVOICE</v-btn>
|
||||
<v-btn color="primary" large @click="print_control" class="ml-0">C KARTU KONTROL</v-btn> -->
|
||||
<template>
|
||||
|
||||
<v-menu offset-y top>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="orange"
|
||||
dark
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon class="mr-1">print</v-icon>
|
||||
Cetak
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-tile
|
||||
v-for="(item, index) in menu_print"
|
||||
:key="index"
|
||||
@click="print_me(item.code)"
|
||||
>
|
||||
<v-list-tile-title>{{ item.title }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
|
||||
</template>
|
||||
|
||||
<v-btn color="primary" @click="reset" class="ml-0 mr-0">
|
||||
<v-icon class="mr-1">description</v-icon> BARU</v-btn>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs3>
|
||||
<div class="text-tagihan text-xs-right"><kbd>{{ one_money(payment_total) }}</kbd></div>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-fo-registration-payment-finish></one-fo-registration-payment-finish>
|
||||
<one-dialog-print></one-dialog-print>
|
||||
</v-layout>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.label-tagihan{
|
||||
text-align:left;
|
||||
font-size: 25px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
.sub-header{
|
||||
text-align:left;
|
||||
font-size: 18px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
.sub-title{
|
||||
text-align:left;
|
||||
font-size: 14px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
.text-tagihan{
|
||||
text-align:left;
|
||||
font-size: 42px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
}
|
||||
|
||||
.input-cash{
|
||||
width: 100%;
|
||||
/* padding: 8px 14px; */
|
||||
/* box-sizing: border-box; */
|
||||
/* border: 2px solid grey;
|
||||
border-radius: 4px; */
|
||||
font-size: 22px;
|
||||
font-weight:700;
|
||||
text-align:right;
|
||||
}
|
||||
.input-plain{
|
||||
width: 100%;
|
||||
/* padding: 4px 8px; */
|
||||
/* box-sizing: border-box; */
|
||||
/* border: 2px solid grey;
|
||||
border-radius: 4px; */
|
||||
font-size: 14px;
|
||||
}
|
||||
.v-input, .v-input__slot, .v-messages{
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
min-height: 0px;
|
||||
}
|
||||
.v-input--selection-controls:not(.v-input--hide-details) .v-input__slot {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.border-top-dashed {
|
||||
border-top: 1px dashed rgb(221,221,221)
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-field-verification' : httpVueLoader('../../common/oneFieldVerificationSupply.vue'),
|
||||
'one-fo-registration-payment-finish' : httpVueLoader('./oneFoRegistrationPaymentFinish.vue'),
|
||||
'one-dialog-print' : httpVueLoader('./oneDialogPrint.vue')
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
checkbox: true,
|
||||
radioGroup: 1,
|
||||
switchCash: true,
|
||||
switchDebit: false,
|
||||
switchKredit: false,
|
||||
|
||||
switch_payment_enable: [],
|
||||
|
||||
payment_amount: [],
|
||||
menu_print: [
|
||||
{ title:"Cetak Invoice", code:"P.INV" },
|
||||
{ title:"Cetak Kartu Kontrol", code:"P.CC" }
|
||||
],
|
||||
init_val_edc:{"CREDIT":0,"DEBIT":0},
|
||||
init_val_card:{"CREDIT":0,"DEBIT":0},
|
||||
init_val_account:{"CREDIT":0,"DEBIT":0,"TRANSFER":0}
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
one_money(p) {
|
||||
return window.one_money(p)
|
||||
},
|
||||
|
||||
payment_enable (idx, v) {
|
||||
let payments = this.payments
|
||||
payments[idx]['payment_enable'] = v
|
||||
if (v == "N") {
|
||||
payments[idx]['payment_actual'] = 0
|
||||
payments[idx]['payment_amount'] = 0
|
||||
payments[idx]['payment_card_id'] = 0
|
||||
payments[idx]['payment_edc_id'] = 0
|
||||
payments[idx]['payment_change'] = 0
|
||||
payments[idx]['payment_change_mask'] = 0
|
||||
this.init_val_edc[payments[idx]['payment_type_code']] = 0
|
||||
this.init_val_card[payments[idx]['payment_type_code']] = 0
|
||||
} else {
|
||||
payments[idx]['payment_amount'] = this.bill_rest
|
||||
payments[idx]['payment_actual'] = this.bill_rest
|
||||
}
|
||||
|
||||
this.$store.commit('payment/update_payments', payments)
|
||||
},
|
||||
|
||||
save() {
|
||||
this.$store.dispatch("payment/save");
|
||||
return
|
||||
},
|
||||
|
||||
update_payments (idx, type, v) {
|
||||
let payments = this.payments
|
||||
payments[idx][type] = v
|
||||
this.$store.commit('payment/update_payments', payments)
|
||||
},
|
||||
|
||||
reset () {
|
||||
//location.reload()
|
||||
// alert('dasdasdasd')
|
||||
this.$store.dispatch('payment/reset', {order_id:this.$store.state.payment.order_id,time_start:this.$store.state.order.show_time})
|
||||
},
|
||||
|
||||
print_invoice () {
|
||||
this.$store.dispatch('payment/print_invoice', this.$store.state.payment.order_id)
|
||||
return
|
||||
},
|
||||
|
||||
print_control_xx () {
|
||||
this.$store.dispatch('payment/print_control', this.$store.state.payment.order_id)
|
||||
return
|
||||
},
|
||||
print_control () {
|
||||
this.$store.dispatch('payment/print_control', {order_id:this.$store.state.payment.order_id,time_start:this.$store.state.order.show_time})
|
||||
return
|
||||
},
|
||||
|
||||
print_me (c) {
|
||||
if (c == "P.INV")
|
||||
return this.print_invoice()
|
||||
else if (c == "P.CC")
|
||||
return this.print_control()
|
||||
},
|
||||
|
||||
xxx(v) {
|
||||
alert(v)
|
||||
},
|
||||
|
||||
print_bukti() {
|
||||
this.$store.dispatch('payment/print_nota', this.order_id)
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
bill_total() {
|
||||
return this.selected_order.order_total
|
||||
},
|
||||
|
||||
payment_total () {
|
||||
return this.$store.state.payment.payment_total
|
||||
},
|
||||
|
||||
bill_rest () {
|
||||
return this.bill_total - this.payment_total
|
||||
},
|
||||
|
||||
savepayment () {
|
||||
return this.$store.state.payment.savepayment
|
||||
},
|
||||
|
||||
payment_cash_amount : {
|
||||
get () {
|
||||
return this.$store.state.payment.order_total
|
||||
},
|
||||
set (v) {
|
||||
// this.$store.commit('payment/update_payment', {type:'cash',amount:v})
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
payment_debit_amount : {
|
||||
get () {
|
||||
return 0
|
||||
},
|
||||
set (v) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
payment_credit_amount : {
|
||||
get () {
|
||||
return 0
|
||||
},
|
||||
set (v) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
payments : {
|
||||
get () {
|
||||
let p = this.$store.state.payment.payments
|
||||
for (let i in p)
|
||||
p[i].payment_change_mask = window.one_money(p[i].payment_change)
|
||||
|
||||
return p
|
||||
// [{"payment_type_id":"1","payment_type_name":"Cash","payment_type_code":"CASH","payment_amount":"0","payment_note":"","payment_note_label":"Kembali","payment_enable":"N"},{"payment_type_id":"2","payment_type_name":"Debit","payment_type_code":"DEBIT","payment_amount":"0","payment_note":"","payment_note_label":"Nomor Kartu","payment_enable":"N"},{"payment_type_id":"3","payment_type_name":"Credit","payment_type_code":"CREDIT","payment_amount":"0","payment_note":"","payment_note_label":"Nomor Kartu","payment_enable":"N"},{"payment_type_id":"4","payment_type_name":"Voucher","payment_type_code":"VOUCHER","payment_amount":"0","payment_note":"","payment_note_label":"Nomor Voucher","payment_enable":"N"}]
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('payment/update_payments', v)
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
order_id : {
|
||||
get () {
|
||||
return this.$store.state.payment.order_id
|
||||
},
|
||||
|
||||
set (v) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
btn_save_enable () {
|
||||
if (this.payments.length < 1)
|
||||
return false
|
||||
|
||||
let en = false
|
||||
let sm = 0
|
||||
for (let i in this.payments) {
|
||||
let p = this.payments[i]
|
||||
if (p.payment_enable == "Y") {
|
||||
en = true
|
||||
sm = sm + Math.round(p.payment_amount)
|
||||
|
||||
// IF DEBIT OR CREDIT
|
||||
if (['DEBIT', 'CREDIT'].indexOf(p.payment_type_code) > -1) {
|
||||
if (p.payment_card_id == 0 || p.payment_account_id == 0)
|
||||
en = false
|
||||
}
|
||||
|
||||
if (['TRANSFER'].indexOf(p.payment_type_code) > -1) {
|
||||
if (p.payment_account_id == 0)
|
||||
en = false
|
||||
}
|
||||
|
||||
console.log(p.payment_type_code + '-' + en)
|
||||
}
|
||||
}
|
||||
|
||||
if (!en) return false
|
||||
|
||||
if (this.$store.state.payment.order_id == 0 ||
|
||||
this.$store.state.payment.order_id == "0")
|
||||
return false;
|
||||
|
||||
if (sm == 0)
|
||||
return false
|
||||
|
||||
return true
|
||||
},
|
||||
|
||||
paid : {
|
||||
get () { return this.$store.state.payment.paid },
|
||||
set (v) { this.$store.commit('payment/update_paid', v) }
|
||||
},
|
||||
selected_order() {
|
||||
return this.$store.state.patient.selected_patient
|
||||
},
|
||||
|
||||
order_company () {
|
||||
return this.$store.state.payment.order_company
|
||||
},
|
||||
|
||||
banks () {
|
||||
return this.$store.state.other.banks
|
||||
},
|
||||
|
||||
cards () {
|
||||
return this.$store.state.other.cards
|
||||
},
|
||||
|
||||
accounts () {
|
||||
return this.$store.state.other.accounts
|
||||
},
|
||||
|
||||
is_bill () {
|
||||
return this.$store.state.company.selected_mou.M_MouIsBill == "Y"
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('payment/search')
|
||||
this.$store.dispatch('other/search_bank')
|
||||
this.$store.dispatch('other/search_card')
|
||||
this.$store.dispatch('other/search_accounts')
|
||||
},
|
||||
|
||||
watch : {
|
||||
switch_payment_enable (n, o) {
|
||||
if (n != o) {
|
||||
if (n.length < o.length) {
|
||||
for (let i in o)
|
||||
if (n.indexOf(o[i]) < 0)
|
||||
return
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
order_id (n, o) {
|
||||
if (n == 0 || n == "0")
|
||||
this.$store.commit("order/update_tab_enable", [2, false])
|
||||
else
|
||||
this.$store.commit("order/update_tab_enable", [2, true])
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,525 @@
|
||||
<template>
|
||||
<v-layout column pb-2>
|
||||
<v-card >
|
||||
<v-layout row pa-2 align-center wrap >
|
||||
<v-flex xs6>
|
||||
<div class="label-tagihan text-xs-left">Total Tagihan</div>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1 class="mt-3"></v-layout>
|
||||
|
||||
<v-layout row wrap v-show="order_company.is_bill == 'N'">
|
||||
<v-flex xs6>
|
||||
<h3 class="subheading orange--text">Minimum DP ({{ order_company.min_dp }}%)</h3>
|
||||
</v-flex>
|
||||
<v-flex xs6>
|
||||
<h3 class="subheading text-xs-right orange--text">{{ one_money(order_company.min_dp_rp) }}</h3>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap v-show="order_company.is_bill == 'Y' && order_company.on_hold == 'Y'">
|
||||
<v-flex xs12>
|
||||
<h3 class="subheading red--text">{{ order_company.on_hold_text }}</h3>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
<v-flex xs6>
|
||||
<div class="text-tagihan text-xs-right"><kbd>{{ one_money(bill_total) }}</kbd></div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
|
||||
<v-layout column>
|
||||
<v-flex xs12 v-for="(p, pi) in payments" v-bind:key="p.payment_type_id">
|
||||
|
||||
<v-layout row pt-2 pb-1 pl-2 align-center wrap class="border-top-dashed">
|
||||
<v-flex xs12>
|
||||
<v-switch
|
||||
true-value="Y"
|
||||
false-value="N"
|
||||
v-model="payments[pi].payment_enable"
|
||||
:label="p.payment_type_name"
|
||||
@change="(v) => payment_enable(pi, v)"
|
||||
:disabled="paid"
|
||||
></v-switch>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row pa-2 wrap >
|
||||
|
||||
<v-flex xs4 pr-2>
|
||||
<!-- <div class="pa-2"> -->
|
||||
<v-text-field
|
||||
v-bind:class="[p.payment_type_code == 'CASH' ? 'input-cash' : 'input-plain', 'text-xs-right font-weight-bold']"
|
||||
v-model="payments[pi].payment_actual"
|
||||
:disabled="paid || (payments[pi].payment_enable == 'Y' ? false : true)"
|
||||
@input="(v) => update_payments(pi, 'payment_actual', v)"
|
||||
reverse
|
||||
label="Jumlah"
|
||||
outline
|
||||
>
|
||||
</v-text-field>
|
||||
|
||||
<!-- </div> -->
|
||||
</v-flex>
|
||||
<v-flex xs4 v-if="['CASH', 'VOUCHER'].indexOf(p.payment_type_code) > -1">
|
||||
<!-- <div class="pa-2"> -->
|
||||
<v-text-field
|
||||
v-show="p.payment_type_code == 'VOUCHER'"
|
||||
class="input-plain"
|
||||
v-model="payments[pi].payment_note"
|
||||
:disabled="paid || (payments[pi].payment_enable == 'Y' ? false : true)"
|
||||
@input="(v) => update_payments(pi, 'payment_amount', v)"
|
||||
reverse
|
||||
:label="p.payment_note_label"
|
||||
outline
|
||||
>
|
||||
</v-text-field>
|
||||
|
||||
<v-text-field
|
||||
v-show="p.payment_type_code == 'CASH'"
|
||||
class="input-cash"
|
||||
v-model="payments[pi].payment_change_mask"
|
||||
disabled
|
||||
reverse
|
||||
:label="p.payment_note_label"
|
||||
outline
|
||||
>
|
||||
</v-text-field>
|
||||
<!-- </div> -->
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs4 v-if="['CREDIT', 'DEBIT'].indexOf(p.payment_type_code) > -1" pr-2>
|
||||
<v-autocomplete
|
||||
:items="cards"
|
||||
item-text="Nat_BankName"
|
||||
item-value="Nat_BankID"
|
||||
outline
|
||||
hide-details
|
||||
height="30"
|
||||
label="Kartu"
|
||||
@change="(v) => update_payments(pi, 'payment_card_id', v)"
|
||||
v-model="init_val_card[p.payment_type_code]"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs4 v-if="['CREDIT', 'DEBIT'].indexOf(p.payment_type_code) > -1">
|
||||
<!-- <v-autocomplete
|
||||
:items="banks"
|
||||
item-text="Nat_BankName"
|
||||
item-value="Nat_BankID"
|
||||
outline
|
||||
hide-details
|
||||
height="30"
|
||||
label="EDC"
|
||||
@change="(v) => update_payments(pi, 'payment_edc_id', v)"
|
||||
v-model="init_val_edc[p.payment_type_code]"
|
||||
></v-autocomplete> X -->
|
||||
|
||||
<v-autocomplete
|
||||
:items="accounts"
|
||||
item-text="M_BankAccountNo"
|
||||
item-value="M_BankAccountID"
|
||||
outline
|
||||
hide-details
|
||||
height="30"
|
||||
label="EDC"
|
||||
@change="(v) => update_payments(pi, 'payment_account_id', v)"
|
||||
v-model="init_val_account[p.payment_type_code]"
|
||||
></v-autocomplete>
|
||||
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs4 v-if="['TRANSFER'].indexOf(p.payment_type_code) > -1" pr-2>
|
||||
<v-autocomplete
|
||||
:items="accounts"
|
||||
item-text="M_BankAccountNo"
|
||||
item-value="M_BankAccountID"
|
||||
outline
|
||||
hide-details
|
||||
height="30"
|
||||
label="No Rekening"
|
||||
@change="(v) => update_payments(pi, 'payment_account_id', v)"
|
||||
v-model="init_val_account[p.payment_type_code]"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
|
||||
<!-- <v-layout row pa-2 align-center wrap >
|
||||
<div>
|
||||
<v-btn color="error" dark large @click="save" :disabled="!btn_save_enable">BAYAR</v-btn>
|
||||
</div>
|
||||
</v-layout> -->
|
||||
<v-layout row pa-2 wrap >
|
||||
|
||||
<v-flex xs9>
|
||||
<div>
|
||||
<v-btn v-show="!is_bill" color="error" :dark="btn_save_enable && !paid" @click="save" :disabled="!btn_save_enable || paid || savepayment" class="mr-0">SIMPAN & BAYAR</v-btn>
|
||||
<v-btn v-show="is_bill" color="error" dark @click="print_bukti" class="mr-0">BUKTI PEMERIKSAAN</v-btn>
|
||||
|
||||
<!-- <v-btn color="primary" large @click="print_invoice" class="ml-0 mr-0">C INVOICE</v-btn>
|
||||
<v-btn color="primary" large @click="print_control" class="ml-0">C KARTU KONTROL</v-btn> -->
|
||||
<template>
|
||||
|
||||
<v-menu offset-y top>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn
|
||||
color="orange"
|
||||
dark
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon class="mr-1">print</v-icon>
|
||||
Cetak
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-tile
|
||||
v-for="(item, index) in menu_print"
|
||||
:key="index"
|
||||
@click="print_me(item.code)"
|
||||
>
|
||||
<v-list-tile-title>{{ item.title }}</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
|
||||
</template>
|
||||
|
||||
<v-btn color="primary" @click="reset" class="ml-0 mr-0">
|
||||
<v-icon class="mr-1">description</v-icon> BARU</v-btn>
|
||||
</div>
|
||||
</v-flex>
|
||||
<v-flex xs3>
|
||||
<div class="text-tagihan text-xs-right"><kbd>{{ one_money(payment_total) }}</kbd></div>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-fo-registration-payment-finish></one-fo-registration-payment-finish>
|
||||
<one-dialog-print></one-dialog-print>
|
||||
</v-layout>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.label-tagihan{
|
||||
text-align:left;
|
||||
font-size: 25px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
.sub-header{
|
||||
text-align:left;
|
||||
font-size: 18px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
.sub-title{
|
||||
text-align:left;
|
||||
font-size: 14px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
.text-tagihan{
|
||||
text-align:left;
|
||||
font-size: 42px;
|
||||
font-family: open sans, tahoma, sans-serif;
|
||||
}
|
||||
|
||||
.input-cash{
|
||||
width: 100%;
|
||||
/* padding: 8px 14px; */
|
||||
/* box-sizing: border-box; */
|
||||
/* border: 2px solid grey;
|
||||
border-radius: 4px; */
|
||||
font-size: 22px;
|
||||
font-weight:700;
|
||||
text-align:right;
|
||||
}
|
||||
.input-plain{
|
||||
width: 100%;
|
||||
/* padding: 4px 8px; */
|
||||
/* box-sizing: border-box; */
|
||||
/* border: 2px solid grey;
|
||||
border-radius: 4px; */
|
||||
font-size: 14px;
|
||||
}
|
||||
.v-input, .v-input__slot, .v-messages{
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
min-height: 0px;
|
||||
}
|
||||
.v-input--selection-controls:not(.v-input--hide-details) .v-input__slot {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.border-top-dashed {
|
||||
border-top: 1px dashed rgb(221,221,221)
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-field-verification' : httpVueLoader('../../common/oneFieldVerificationSupply.vue'),
|
||||
'one-fo-registration-payment-finish' : httpVueLoader('./oneFoRegistrationPaymentFinish.vue'),
|
||||
'one-dialog-print' : httpVueLoader('./oneDialogPrint.vue')
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
checkbox: true,
|
||||
radioGroup: 1,
|
||||
switchCash: true,
|
||||
switchDebit: false,
|
||||
switchKredit: false,
|
||||
|
||||
switch_payment_enable: [],
|
||||
|
||||
payment_amount: [],
|
||||
menu_print: [
|
||||
{ title:"Cetak Invoice", code:"P.INV" },
|
||||
{ title:"Cetak Kartu Kontrol", code:"P.CC" }
|
||||
],
|
||||
init_val_edc:{"CREDIT":0,"DEBIT":0},
|
||||
init_val_card:{"CREDIT":0,"DEBIT":0},
|
||||
init_val_account:{"CREDIT":0,"DEBIT":0,"TRANSFER":0}
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
one_money(p) {
|
||||
return window.one_money(p)
|
||||
},
|
||||
|
||||
payment_enable (idx, v) {
|
||||
let payments = this.payments
|
||||
payments[idx]['payment_enable'] = v
|
||||
if (v == "N") {
|
||||
payments[idx]['payment_actual'] = 0
|
||||
payments[idx]['payment_amount'] = 0
|
||||
payments[idx]['payment_card_id'] = 0
|
||||
payments[idx]['payment_edc_id'] = 0
|
||||
payments[idx]['payment_change'] = 0
|
||||
payments[idx]['payment_change_mask'] = 0
|
||||
this.init_val_edc[payments[idx]['payment_type_code']] = 0
|
||||
this.init_val_card[payments[idx]['payment_type_code']] = 0
|
||||
} else {
|
||||
payments[idx]['payment_amount'] = this.bill_rest
|
||||
payments[idx]['payment_actual'] = this.bill_rest
|
||||
}
|
||||
|
||||
this.$store.commit('payment/update_payments', payments)
|
||||
},
|
||||
|
||||
save() {
|
||||
this.$store.dispatch("payment/save");
|
||||
return
|
||||
},
|
||||
|
||||
update_payments (idx, type, v) {
|
||||
let payments = this.payments
|
||||
payments[idx][type] = v
|
||||
this.$store.commit('payment/update_payments', payments)
|
||||
},
|
||||
|
||||
reset () {
|
||||
//location.reload()
|
||||
this.$store.dispatch('payment/reset', {order_id:this.$store.state.payment.order_id,time_start:this.$store.state.order.show_time})
|
||||
},
|
||||
|
||||
print_invoice () {
|
||||
this.$store.dispatch('payment/print_invoice', this.$store.state.payment.order_id)
|
||||
return
|
||||
},
|
||||
|
||||
print_control_xx () {
|
||||
this.$store.dispatch('payment/print_control', this.$store.state.payment.order_id)
|
||||
return
|
||||
},
|
||||
print_control () {
|
||||
this.$store.dispatch('payment/print_control', {order_id:this.$store.state.payment.order_id,time_start:this.$store.state.order.show_time})
|
||||
return
|
||||
},
|
||||
|
||||
print_me (c) {
|
||||
if (c == "P.INV")
|
||||
return this.print_invoice()
|
||||
else if (c == "P.CC")
|
||||
return this.print_control()
|
||||
},
|
||||
|
||||
xxx(v) {
|
||||
alert(v)
|
||||
},
|
||||
|
||||
print_bukti() {
|
||||
this.$store.dispatch('payment/print_nota', this.order_id)
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
bill_total() {
|
||||
return this.$store.state.payment.order_total
|
||||
},
|
||||
|
||||
payment_total () {
|
||||
return this.$store.state.payment.payment_total
|
||||
},
|
||||
|
||||
bill_rest () {
|
||||
return this.bill_total - this.payment_total
|
||||
},
|
||||
|
||||
savepayment () {
|
||||
return this.$store.state.payment.savepayment
|
||||
},
|
||||
|
||||
payment_cash_amount : {
|
||||
get () {
|
||||
return this.$store.state.payment.order_total
|
||||
},
|
||||
set (v) {
|
||||
// this.$store.commit('payment/update_payment', {type:'cash',amount:v})
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
payment_debit_amount : {
|
||||
get () {
|
||||
return 0
|
||||
},
|
||||
set (v) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
payment_credit_amount : {
|
||||
get () {
|
||||
return 0
|
||||
},
|
||||
set (v) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
payments : {
|
||||
get () {
|
||||
let p = this.$store.state.payment.payments
|
||||
for (let i in p)
|
||||
p[i].payment_change_mask = window.one_money(p[i].payment_change)
|
||||
|
||||
return p
|
||||
// [{"payment_type_id":"1","payment_type_name":"Cash","payment_type_code":"CASH","payment_amount":"0","payment_note":"","payment_note_label":"Kembali","payment_enable":"N"},{"payment_type_id":"2","payment_type_name":"Debit","payment_type_code":"DEBIT","payment_amount":"0","payment_note":"","payment_note_label":"Nomor Kartu","payment_enable":"N"},{"payment_type_id":"3","payment_type_name":"Credit","payment_type_code":"CREDIT","payment_amount":"0","payment_note":"","payment_note_label":"Nomor Kartu","payment_enable":"N"},{"payment_type_id":"4","payment_type_name":"Voucher","payment_type_code":"VOUCHER","payment_amount":"0","payment_note":"","payment_note_label":"Nomor Voucher","payment_enable":"N"}]
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('payment/update_payments', v)
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
order_id : {
|
||||
get () {
|
||||
return this.$store.state.payment.order_id
|
||||
},
|
||||
|
||||
set (v) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
btn_save_enable () {
|
||||
if (this.payments.length < 1)
|
||||
return false
|
||||
|
||||
let en = false
|
||||
let sm = 0
|
||||
for (let i in this.payments) {
|
||||
let p = this.payments[i]
|
||||
if (p.payment_enable == "Y") {
|
||||
en = true
|
||||
sm = sm + Math.round(p.payment_amount)
|
||||
|
||||
// IF DEBIT OR CREDIT
|
||||
if (['DEBIT', 'CREDIT'].indexOf(p.payment_type_code) > -1) {
|
||||
if (p.payment_card_id == 0 || p.payment_account_id == 0)
|
||||
en = false
|
||||
}
|
||||
|
||||
if (['TRANSFER'].indexOf(p.payment_type_code) > -1) {
|
||||
if (p.payment_account_id == 0)
|
||||
en = false
|
||||
}
|
||||
|
||||
console.log(p.payment_type_code + '-' + en)
|
||||
}
|
||||
}
|
||||
|
||||
if (!en) return false
|
||||
|
||||
if (this.$store.state.payment.order_id == 0 ||
|
||||
this.$store.state.payment.order_id == "0")
|
||||
return false;
|
||||
|
||||
if (sm == 0)
|
||||
return false
|
||||
|
||||
return true
|
||||
},
|
||||
|
||||
paid : {
|
||||
get () { return this.$store.state.payment.paid },
|
||||
set (v) { this.$store.commit('payment/update_paid', v) }
|
||||
},
|
||||
|
||||
order_company () {
|
||||
return this.$store.state.payment.order_company
|
||||
},
|
||||
|
||||
banks () {
|
||||
return this.$store.state.other.banks
|
||||
},
|
||||
|
||||
cards () {
|
||||
return this.$store.state.other.cards
|
||||
},
|
||||
|
||||
accounts () {
|
||||
return this.$store.state.other.accounts
|
||||
},
|
||||
|
||||
is_bill () {
|
||||
return this.$store.state.company.selected_mou.M_MouIsBill == "Y"
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('payment/search')
|
||||
this.$store.dispatch('other/search_bank')
|
||||
this.$store.dispatch('other/search_card')
|
||||
this.$store.dispatch('other/search_accounts')
|
||||
},
|
||||
|
||||
watch : {
|
||||
switch_payment_enable (n, o) {
|
||||
if (n != o) {
|
||||
if (n.length < o.length) {
|
||||
for (let i in o)
|
||||
if (n.indexOf(o[i]) < 0)
|
||||
return
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
order_id (n, o) {
|
||||
if (n == 0 || n == "0")
|
||||
this.$store.commit("order/update_tab_enable", [2, false])
|
||||
else
|
||||
this.$store.commit("order/update_tab_enable", [2, true])
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
width="500"
|
||||
>
|
||||
|
||||
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
Pembayaran Berhasil
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<h6 class="display-1 text-center">No Pembayaran <span class="blue--text">{{ text_payno }}</span></h6>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-btn
|
||||
color="warning"
|
||||
@click="print_nota"
|
||||
class="ml-2"
|
||||
>
|
||||
CETAK NOTA
|
||||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
color="success"
|
||||
@click="print_notain"
|
||||
class="ml-2"
|
||||
>
|
||||
CETAK NOTA IN
|
||||
</v-btn>
|
||||
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="primary"
|
||||
flat
|
||||
@click="finish"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
|
||||
},
|
||||
methods : {
|
||||
tuing: function() {
|
||||
alert('x')
|
||||
},
|
||||
|
||||
finish: function() {
|
||||
this.dialog = false
|
||||
// location.reload()
|
||||
},
|
||||
|
||||
print_nota () {
|
||||
this.$store.dispatch('payment/print_nota', this.$store.state.payment.payment_id)
|
||||
return
|
||||
},
|
||||
|
||||
print_notain () {
|
||||
this.$store.dispatch('payment/print_notain', this.$store.state.payment.payment_id)
|
||||
return
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
dialog: {
|
||||
get() {
|
||||
return this.$store.state.payment.finish_dialog_is_active;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('payment/update_finish_dialog_is_active', val);
|
||||
}
|
||||
},
|
||||
|
||||
text_payno () {
|
||||
return this.$store.state.payment.payment_number
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,599 @@
|
||||
<template>
|
||||
<v-layout column pb-0>
|
||||
<v-dialog
|
||||
v-model="dialog_alert_msg"
|
||||
width="60%"
|
||||
>
|
||||
|
||||
|
||||
<v-card >
|
||||
<v-card-title
|
||||
class="subtitle-1 white--text"
|
||||
style="background:#ee7777"
|
||||
|
||||
>
|
||||
PEMBERITAHUAN !
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text v-html="alert_msg">
|
||||
|
||||
</v-card-text>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="grey"
|
||||
flat
|
||||
@click="dialog_alert_msg = false"
|
||||
>
|
||||
OK ... saya mengerti
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!--#95eaf3-->
|
||||
<v-card flat>
|
||||
<table>
|
||||
<tr style="background:#64b2cd">
|
||||
<th style="width:7%;font-weight:bold;font-size:12px;color:#fff" class="text-md-center pt-2 pb-2"> </th>
|
||||
<!---- <th style="width:7%;font-weight:bold;font-size:12px;color:#fff" class="text-md-center pt-2 pb-2">CITO</th> --->
|
||||
<th style="width:45%;font-weight:bold;font-size:12px;color:#fff" class="text-md-center pt-2 pb-2">PEMERIKSAAN</th>
|
||||
<th style="width:12%;font-weight:bold;font-size:12px;color:#fff" class="text-md-center pt-2 pb-2">BRUTO</th>
|
||||
<th style="width:12%;font-weight:bold;font-size:12px;color:#fff" class="text-md-center pt-2 pb-2">DISKON</th>
|
||||
<th style="width:14%;font-weight:bold;font-size:12px;color:#fff" class="text-md-center pt-2 pb-2">TOTAL</th>
|
||||
</tr>
|
||||
<tr v-if="selected_test.length === 0" >
|
||||
<td class="pa-2 text-xs-center caption" colspan="6">Belum ada order pemeriksaan</td>
|
||||
</tr>
|
||||
<tr v-if="selected_test.length > 0" style="font-size:12px" v-for="t in selected_test" v-bind:key="t.T_TestID">
|
||||
<td class="text-md-center">
|
||||
<v-icon color="#ee7777" @click="deletePx(t)">delete</v-icon>
|
||||
</td>
|
||||
<!----<td class="text-md-left pl-3">
|
||||
<v-checkbox hide-details class="smr-1"
|
||||
:value="t.T_TestID"
|
||||
v-model="cito_test"
|
||||
></v-checkbox>
|
||||
</td>-->
|
||||
|
||||
<td class="text-md-left pl-3">
|
||||
<p class="mb-0 mono caption font-weight-bold" style="color:#3c70a4;font-size:10px!important">{{getTimeX(t.promise)}}</p>
|
||||
<p class="mb-1">{{ t.T_TestName}}</p>
|
||||
<p class="mb-0 caption" v-show="child_test_show(t)">{{child_test(t.child_test)}}</p>
|
||||
</td>
|
||||
<td class="text-md-right mono pr-2">{{ one_money(t.T_PriceAmount) }}</td>
|
||||
<td class="text-md-right mono pr-2">{{ one_money(calc_discount(t)) }}</td>
|
||||
<td class="text-md-right mono font-weight-black pr-2">{{ one_money(calc_netto(t)) }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<!-- TEST PANEL -->
|
||||
<template v-for="p in selected_panel">
|
||||
<tr class="tr-panel">
|
||||
<!-- <td class="text-md-center">
|
||||
<v-icon color="red" @click="deletePanel(p)">delete</v-icon>
|
||||
</td> -->
|
||||
<td class="text-md-left pl-3 pr-2" colspan="4">{{ p.T_TestPanelName}}</td>
|
||||
</tr>
|
||||
<tr v-for="t in p.test" v-bind:key="t.T_TestID">
|
||||
<td class="text-md-center">
|
||||
|
||||
</td>
|
||||
<td class="text-md-left pl-3">{{ t.T_TestName}}</td>
|
||||
<td class="text-md-right pr-2">{{ one_money(t.T_PriceAmount) }}</td>
|
||||
<td class="text-md-right pr-2">{{ one_money(calc_discount(t)) }}</td>
|
||||
<td class="text-md-right pr-2">{{ one_money(calc_netto(t)) }}</td>
|
||||
</tr>
|
||||
</template>
|
||||
<!--/ TEST PANEL -->
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="background:#3c70a4;color:#fff" class="text-md-right pr-5 pt-2 pb-2"></th>
|
||||
<th style="background:#3c70a4;color:#fff" class="text-md-left pl-3 pt-2 pb-2">TOTAL</th>
|
||||
<th style="background:#3c70a4;color:#fff" class="text-md-right pr-2 pt-2 pb-2">{{ one_money(bruto_total) }}</th>
|
||||
<th style="background:#3c70a4;color:#fff" class="text-md-right pr-2 pt-2 pb-2">{{ one_money(diskon_total) }}</th>
|
||||
<th style="background:#3c70a4;color:#fff" class="text-md-right pr-2 pt-2 pb-2" >{{ one_money(sub_total) }}</th>
|
||||
</tr>
|
||||
<tr style="display:none">
|
||||
<th colspan="2" class="text-md-right pr-2 pt-1 pb-1">DISKON PEMBULATAN</th>
|
||||
<th class="text-md-right pr-2 pt-1 pb-1" colspan="2">{{ one_money(discount_pembulatan) }}</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</v-card>
|
||||
<v-card flat>
|
||||
<v-layout row>
|
||||
<v-flex xs4>
|
||||
<v-btn block :disabled="in_saving" v-if="btn_save_enabled && !loading_process" title="simpan order" @click="save_order()" class="mb-1 mt-2 ml-0 mr-0" dark color="#3c70a4">
|
||||
simpan
|
||||
</v-btn>
|
||||
|
||||
<v-btn block v-if="!btn_save_enabled" title="simpan order" @click="check_msg_alert()" class="mb-1 mt-2 ml-0 mr-0 grey darken-1" dark>
|
||||
simpan
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-loading></one-dialog-loading>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.nota {
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
.total {
|
||||
min-height:76px;
|
||||
}
|
||||
table {
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
background:white;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
table>tr>td {
|
||||
padding: 8px;
|
||||
}
|
||||
table>tr>td:first {
|
||||
padding-left:15px!important;
|
||||
}
|
||||
|
||||
.vintage-text{
|
||||
text-shadow: 0px -2px 0px #fff, 0px 2px 3px #fff;
|
||||
}
|
||||
|
||||
.v-input--selection-controls {
|
||||
margin-top: 0px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-dialog-loading': httpVueLoader('../../../../common/oneDialogLoading.vue')
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
current_cito_change : [],
|
||||
dialog_alert_msg:false,
|
||||
alert_msg:''
|
||||
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
cito_test (n, o) {
|
||||
if (n != o) {
|
||||
if (n.length == 0)
|
||||
this.current_cito_change = [o[0], "N"]
|
||||
else if (o.length == 0)
|
||||
this.current_cito_change = [n[0], "Y"]
|
||||
else if (o.length > n.length) {
|
||||
for (let i in o)
|
||||
if (n.indexOf(o[i]) < 0) this.current_cito_change = [o[i], "N"]
|
||||
}
|
||||
else {
|
||||
for (let i in n)
|
||||
if (o.indexOf(n[i]) < 0) this.current_cito_change = [n[i], "Y"]
|
||||
}
|
||||
}
|
||||
|
||||
let is_cito = "N";
|
||||
if (n.length > 0)
|
||||
is_cito = "Y";
|
||||
this.$store.commit('px/update_is_cito', is_cito);
|
||||
|
||||
console.log(this.$store.state.company.selected_mou)
|
||||
let selected_mou = this.$store.state.company.selected_mou
|
||||
let mou_id = selected_mou.price_header_id
|
||||
console.log('mou_id',mou_id)
|
||||
this.$store.dispatch('px/get_price', {
|
||||
test_id:this.current_cito_change[0],
|
||||
mou_id:mou_id,
|
||||
cito:this.current_cito_change[1]})
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getTimeX(xtime) {
|
||||
var xvar = xtime
|
||||
if(xvar)
|
||||
xvar = xvar.split(",")
|
||||
else
|
||||
xvar = []
|
||||
|
||||
var new_time = []
|
||||
if(xvar.length > 0){
|
||||
xvar.forEach(function(xxtime) {
|
||||
//console.log(xxtime)
|
||||
let xxxtime = moment(xxtime).format('DD-MM-YYYY HH:mm')
|
||||
//console.log(xxxtime)
|
||||
new_time.push(xxxtime)
|
||||
})
|
||||
}
|
||||
console.log(new_time)
|
||||
if(new_time.length > 0)
|
||||
return new_time.join(', ')
|
||||
else
|
||||
return ''
|
||||
},
|
||||
one_money(p) {
|
||||
return window.one_money(p)
|
||||
},
|
||||
|
||||
update_req(px) {
|
||||
this.$store.dispatch("px/update_req", px)
|
||||
},
|
||||
|
||||
deletePanel(panel) {
|
||||
let sel = this.selected_panel
|
||||
|
||||
sel.forEach(function(p,idx) {
|
||||
if(p.T_TestPanelID == panel.T_TestPanelID) {
|
||||
sel.splice(idx,1)
|
||||
}
|
||||
});
|
||||
|
||||
this.$store.commit("px/update_selected_panel",sel)
|
||||
let panels = this.$store.state.px.panels
|
||||
if ( panels == undefined ) panels = []
|
||||
panels.push(panel)
|
||||
let dt = {
|
||||
records : panels,
|
||||
total: panels.length
|
||||
}
|
||||
this.$store.commit("px/update_panels",dt)
|
||||
this.update_req()
|
||||
},
|
||||
|
||||
deletePx(test) {
|
||||
this.$store.dispatch("px/delete_px", test)
|
||||
},
|
||||
|
||||
calc_netto(t) {
|
||||
return one_float(t.T_PriceAmount) - one_float(t.T_PriceDisc) / 100 * one_float(t.T_PriceAmount)
|
||||
- one_float(t.T_PriceDiscRp)
|
||||
},
|
||||
|
||||
calc_discount(t) {
|
||||
return ( one_float(t.T_PriceDisc) / 100 * one_float(t.T_PriceAmount) )
|
||||
+ one_float(t.T_PriceDiscRp)
|
||||
},
|
||||
|
||||
save_order() {
|
||||
if (this.in_saving) return;
|
||||
this.in_saving = true;
|
||||
if (!window.one_token()) {
|
||||
this.$store.commit('update_message_error', 'Maaf, koneksi Anda sempat terputus silahkan Log Out dan Login kembali')
|
||||
this.$store.commit('update_dialog_error', true)
|
||||
return
|
||||
}
|
||||
// Loading
|
||||
this.$store.commit('order/update_loading_process', true)
|
||||
this.$store.commit('update_dialog_loading', true)
|
||||
this.$store.dispatch("order/save")
|
||||
return
|
||||
},
|
||||
|
||||
child_test(x) {
|
||||
let y = []
|
||||
for (let i in x)
|
||||
y.push(x[i].T_TestName)
|
||||
return y.join(', ')
|
||||
},
|
||||
|
||||
child_test_show(t) {
|
||||
if (!t.child_test)
|
||||
return false
|
||||
|
||||
if (t.child_test.length < 1)
|
||||
return false
|
||||
|
||||
if (t.px_type != 'PN')
|
||||
return false
|
||||
|
||||
return true
|
||||
},
|
||||
check_msg_alert () {
|
||||
// console.log(this.$store.state.patient.selected_patient.M_PatientID)
|
||||
var msg = ""
|
||||
var validRSample = true
|
||||
var msg_validRSample = ''
|
||||
if(this.$store.state.order.received_sample.flag === 'Y'){
|
||||
var xDate = moment(this.$store.state.order.received_sample.time, 'DDMMYYYYHHmm', true)
|
||||
var validDate = xDate.isValid()
|
||||
if(!validDate){
|
||||
validRSample = validDate
|
||||
msg_validRSample = "<p class='caption mono mb-1'>- Waktu penerimaan sample harus diisi dengan format DD-MM-YYYY HH:MM, contoh : 05-06-2020 11:35 </p>"
|
||||
}
|
||||
else{
|
||||
var xnow = moment(new Date(), 'DDMMYYYYHHmm')
|
||||
validRSample = moment(this.$store.state.order.received_sample.time, 'DDMMYYYYHHmm').isSameOrBefore(xnow)
|
||||
//console.log(validRSample)
|
||||
msg_validRSample = "<p class='caption mono mb-1'>- Apa sample diambil dari masa depan ? </p>"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!this.$store.state.patient.selected_patient.M_PatientID)
|
||||
msg = msg +"<p class='caption mono mb-1'>- Ibarat ibu-ibu kalo belok tanpa lampu sein, bingung dong kalo belum dipilih pasien</p>"
|
||||
|
||||
if(this.$store.state.patient.selected_patient.M_PatientDOB){
|
||||
var xDate = moment(this.$store.state.patient.selected_patient.M_PatientDOB, 'YYYY-MM-DD', true)
|
||||
var xDatenow = moment(new Date(), 'YYYY-MM-DD')
|
||||
var validDOB = xDate.isSameOrBefore(xDatenow)
|
||||
if(!validDOB)
|
||||
msg = msg +"<p class='caption mono mb-1'>- Apa pasien datang dari masa depan ? coba dicek tanggal lahirnya </p>"
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (
|
||||
!this.$store.state.doctor.selected_doctor.M_DoctorID)
|
||||
msg = msg +"<p class='caption mono mb-1'>- Naik kereta beli es krim, mana belum ada dokte pengirim ?</p>"
|
||||
|
||||
|
||||
if (this.$store.state.px.req_status == 'X')
|
||||
msg = msg +"<p class='caption mono mb-1'>- Kalo mau periksa harus ditanya dulu apakah persyaratan sudah memenuhi ?</p>"
|
||||
|
||||
if (this.$store.state.px.req_status == 'N' && this.$store.state.px.reqs.length < 1)
|
||||
msg = msg +"<p class='caption mono mb-1'>- Yang tidak memenuhi persyaratannya apa ya ?</p>"
|
||||
|
||||
var deliveries = this.$store.state.delivery.data_deliveries
|
||||
var checked_deliveries = _.filter(deliveries, function(o) { return o.chex === 'Y' })
|
||||
|
||||
if (checked_deliveries.length === 0)
|
||||
msg = msg +"<p class='caption mono mb-1'>- Pergi wisata ke Purwakarta, hasilnya dikasih ke siapa ?</p>"
|
||||
|
||||
if (this.$store.state.px.selected_test.length < 1)
|
||||
msg = msg +"<p class='caption mono mb-1'>- Jadi total semua nya 0 rupi...eh, ini kok belum ada pemeriksaan ? </p>"
|
||||
|
||||
if (!validRSample)
|
||||
msg = msg +msg_validRSample
|
||||
|
||||
var refs = this.$store.state.reference.selected_reference
|
||||
if (!refs || refs.length === 0) {
|
||||
msg = msg + "<p class='caption mono mb-1'>- Dapat info dari mana nih? Pilih dulu Reference nya</p>"
|
||||
}
|
||||
|
||||
var ordertype = this.$store.state.reference.selected_ordertype
|
||||
if (!ordertype || !ordertype.M_OrderTypeID) {
|
||||
msg = msg + "<p class='caption mono mb-1'>- Jenis ordernya belum dipilih, tentukan dulu Order Type nya</p>"
|
||||
}
|
||||
|
||||
this.alert_msg = msg
|
||||
this.dialog_alert_msg = true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
appx_schedule_computed() {
|
||||
return this.$store.state.px.appx_schedule
|
||||
},
|
||||
promise_by_pxs() {
|
||||
return this.$store.state.px.promise_by_pxs
|
||||
},
|
||||
preregister_promise() {
|
||||
return this.$store.state.order.preregister_promise
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.order.loading_process
|
||||
},
|
||||
loading_data_patient: {
|
||||
get() {
|
||||
return this.$store.state.order.loading_data_patient
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('order/update_loading_data_patient', val)
|
||||
}
|
||||
},
|
||||
selected_panel() {
|
||||
return this.$store.state.px.selected_panel
|
||||
},
|
||||
selected_test() {
|
||||
return this.$store.state.px.selected_test
|
||||
},
|
||||
in_saving: {
|
||||
get() {
|
||||
return this.$store.state.order.in_saving
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("order/update_in_saving", val)
|
||||
}
|
||||
},
|
||||
discount_pembulatan() {
|
||||
//sipe : set to 0
|
||||
return 0
|
||||
let st = this.sub_total
|
||||
let part = st%1000
|
||||
if (part > 500) return part - 500
|
||||
if (part < 500 && part > 0 ) return part
|
||||
return 0
|
||||
},
|
||||
grand_total() {
|
||||
let gt = this.sub_total - this.discount_pembulatan
|
||||
return gt
|
||||
},
|
||||
sub_total() {
|
||||
let tests = this.selected_test
|
||||
sub_total = 0
|
||||
tests.forEach(function(t,idx) {
|
||||
let price = t.T_PriceAmount - t.T_PriceDisc / 100 * t.T_PriceAmount
|
||||
- t.T_PriceDiscRp
|
||||
sub_total += price
|
||||
})
|
||||
let panels = this.selected_panel
|
||||
panels.forEach(function(p) {
|
||||
let tests = p.test
|
||||
tests.forEach(function(t,idx) {
|
||||
let price = t.T_PriceAmount - t.T_PriceDisc / 100 * t.T_PriceAmount
|
||||
- t.T_PriceDiscRp
|
||||
sub_total += price
|
||||
})
|
||||
|
||||
})
|
||||
return sub_total
|
||||
},
|
||||
bruto_total() {
|
||||
let tests = this.selected_test
|
||||
bruto_total = 0
|
||||
tests.forEach(function(t,idx) {
|
||||
//console.log(t.T_PriceAmount)
|
||||
bruto_total += parseInt(t.T_PriceAmount)
|
||||
//console.log(bruto_total)
|
||||
})
|
||||
let panels = this.selected_panel
|
||||
panels.forEach(function(p) {
|
||||
let tests = p.test
|
||||
tests.forEach(function(t,idx) {
|
||||
bruto_total += parseInt(t.T_PriceAmount)
|
||||
})
|
||||
|
||||
})
|
||||
return bruto_total
|
||||
},
|
||||
diskon_total() {
|
||||
let tests = this.selected_test
|
||||
diskon_total = 0
|
||||
tests.forEach(function(t,idx) {
|
||||
let price = parseInt(t.T_PriceDisc) / 100 * parseInt(t.T_PriceAmount) + parseInt(t.T_PriceDiscRp)
|
||||
diskon_total += price
|
||||
})
|
||||
let panels = this.selected_panel
|
||||
panels.forEach(function(p) {
|
||||
let tests = p.test
|
||||
tests.forEach(function(t,idx) {
|
||||
let price = parseInt(t.T_PriceDisc) / 100 * parseInt(t.T_PriceAmount) + parseInt(t.T_PriceDiscRp)
|
||||
diskon_total += price
|
||||
})
|
||||
|
||||
})
|
||||
return diskon_total
|
||||
},
|
||||
|
||||
xxxbtn_save_enabled () {
|
||||
// console.log(this.$store.state.patient.selected_patient.M_PatientID)
|
||||
if (!this.$store.state.patient.selected_patient.M_PatientID ||
|
||||
!this.$store.state.patient.selected_patient.M_PatientName ||
|
||||
!this.$store.state.patient.selected_patient.M_PatientNoReg ||
|
||||
!this.$store.state.patient.selected_patient.M_PatientDOB ||
|
||||
!this.$store.state.patient.selected_patient.patient_age ||
|
||||
this.$store.state.px.selected_test.length < 1)
|
||||
return false;
|
||||
|
||||
if (this.$store.state.px.req_status == 'X')
|
||||
return false
|
||||
|
||||
//alert(this.$store.state.px.req_status)
|
||||
if (this.$store.state.px.req_status == 'N' && this.$store.state.px.reqs.length < 1)
|
||||
return false
|
||||
|
||||
if(this.loading_data_patient == false)
|
||||
return false
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
||||
var deliveries = this.$store.state.delivery.data_deliveries
|
||||
var checked_deliveries = _.filter(deliveries, function(o) { return o.chex === 'Y' })
|
||||
|
||||
if (checked_deliveries.length === 0)
|
||||
return false
|
||||
*/
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
},
|
||||
btn_save_enabled () {
|
||||
// console.log(this.$store.state.patient.selected_patient.M_PatientID)
|
||||
var validRSample = true
|
||||
if(this.$store.state.order.received_sample.flag === 'Y'){
|
||||
var xDate = moment(this.$store.state.order.received_sample.time, 'DDMMYYYYHHmm', true)
|
||||
validDate = xDate.isValid()
|
||||
if(!validDate){
|
||||
validRSample = validDate
|
||||
|
||||
}
|
||||
else{
|
||||
var xnow = moment(new Date(), 'DDMMYYYYHHmm')
|
||||
validRSample = moment(this.$store.state.order.received_sample.time, 'DDMMYYYYHHmm').isSameOrBefore(xnow)
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.$store.commit("order/update_received_sample", {flag:"N",time:""})
|
||||
}
|
||||
|
||||
|
||||
|
||||
//console.log(validRSample)
|
||||
var xDate = moment(this.$store.state.patient.selected_patient.M_PatientDOB, 'YYYY-MM-DD', true)
|
||||
//console.log(this.$store.state.patient.selected_patient.M_PatientDOB)
|
||||
//console.log(xDate)
|
||||
var xDatenow = moment(new Date(), 'YYYY-MM-DD')
|
||||
//console.log(xDatenow)
|
||||
var validDOB = xDate.isSameOrBefore(xDatenow)
|
||||
//console.log(validDOB)
|
||||
//console.log('dob here btn')
|
||||
var refs = this.$store.state.reference.selected_reference
|
||||
var ordertype = this.$store.state.reference.selected_ordertype
|
||||
if (!this.$store.state.patient.selected_patient.M_PatientID ||
|
||||
!this.$store.state.patient.selected_patient.M_PatientName ||
|
||||
!this.$store.state.patient.selected_patient.M_PatientNoReg ||
|
||||
!this.$store.state.patient.selected_patient.M_PatientDOB ||
|
||||
!this.$store.state.patient.selected_patient.patient_age ||
|
||||
!this.$store.state.doctor.selected_doctor.M_DoctorID ||
|
||||
!this.$store.state.doctor.selected_doctor.M_DoctorName ||
|
||||
this.$store.state.px.selected_test.length < 1 ||
|
||||
!validRSample || !validDOB ||
|
||||
!refs || refs.length === 0 ||
|
||||
!ordertype || !ordertype.M_OrderTypeID)
|
||||
return false;
|
||||
|
||||
|
||||
if (this.$store.state.px.req_status == 'X')
|
||||
return false
|
||||
|
||||
if (this.$store.state.px.req_status == 'N' && this.$store.state.px.reqs.length < 1)
|
||||
return false
|
||||
|
||||
var deliveries = this.$store.state.delivery.data_deliveries
|
||||
var checked_deliveries = _.filter(deliveries, function(o) { return o.chex === 'Y' })
|
||||
|
||||
if (checked_deliveries.length === 0)
|
||||
return false
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
|
||||
cito_test : {
|
||||
get () {
|
||||
return this.$store.state.px.cito.test
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('px/update_cito', {t:'test', v:v})
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,305 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<v-layout column pb-2>
|
||||
<v-card mb-2 class="one-fo-requirement">
|
||||
<!--<v-subheader red--text text--lighten-1>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs3>
|
||||
<span>JANJI HASIL :</span>
|
||||
</v-flex>
|
||||
<v-flex xs3>
|
||||
<span v-show="!cito_show && is_cito == 'Y'" class="mr-4 blue--text"><a href="javascript:;" class=" blue--text" @click="cito_show=!cito_show"><v-icon small>priority_high</v-icon> {{ selected_cito ? selected_cito.Nat_CitoName : '' }}</a></span>
|
||||
<v-select
|
||||
:items="citos"
|
||||
item-text="Nat_CitoName"
|
||||
item-value="Nat_CitoID"
|
||||
return-object
|
||||
|
||||
hide-details
|
||||
dense
|
||||
v-model="selected_cito"
|
||||
height="30"
|
||||
v-show="cito_show && is_cito == 'Y'"
|
||||
class="mt-0 pt-0"
|
||||
append-icon="clear"
|
||||
@click:append="selected_cito = null"
|
||||
></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="text-xs-right">
|
||||
<span class="red--text">Perkiraan Janji Hasil : {{ appx_schedule }}</span>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-subheader>
|
||||
|
||||
<v-divider></v-divider>-->
|
||||
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pt-2>
|
||||
<v-card color="#f3e595" outlined flat >
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<v-layout align-center row wrap>
|
||||
<v-flex xs6>
|
||||
<p v-if="req_status == 'X'" class="mb-0 subtitle-1 font-weight-black">Apakah persyaratan terpenuhi ?</p>
|
||||
<p v-if="req_status == 'N'" class="mb-0 subtitle-1 font-weight-black">Pilih salah satu yang belum terpenuhi</p>
|
||||
<p v-if="req_status == 'Y'" class="mb-0 subtitle-1 font-weight-black">Mantap ! sudah terpenuhi semua</p>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="text-xs-right">
|
||||
<v-btn small
|
||||
:color="req_status == 'N' ? '#ee7777' : 'white'"
|
||||
class="one-btn-icon mr-1 ma-0"
|
||||
:depressed="req_status == 'N' ? true : false"
|
||||
:dark="req_status == 'N'"
|
||||
@click="reqMeNot">
|
||||
<v-icon small>clear</v-icon>
|
||||
</v-btn>
|
||||
|
||||
<v-btn small
|
||||
:color="req_status == 'Y' ? '#40a798' : 'white'"
|
||||
class="one-btn-icon mr-1 ma-0"
|
||||
:dark="req_status == 'Y'"
|
||||
:depressed="req_status == 'Y' ? true : false"
|
||||
@click="reqMe">
|
||||
<v-icon small>done</v-icon>
|
||||
</v-btn>
|
||||
<!-- <v-btn color="red" class="one-btn-icon mr-1 ma-0" @click="sampleReq"
|
||||
v-show="req_status == 'X' || req_status == 'N'"
|
||||
:disabled="req_status != 'X'"
|
||||
:dark="req_status == 'X'">
|
||||
<v-icon>clear</v-icon>
|
||||
</v-btn>
|
||||
|
||||
<v-btn color="green" class="one-btn-icon ma-0" @click="sampleReqOK"
|
||||
v-show="req_status == 'X' || req_status == 'Y'"
|
||||
:disabled="req_status != 'X'"
|
||||
:dark="req_status == 'X'">
|
||||
<v-icon>done</v-icon>
|
||||
</v-btn> -->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
|
||||
|
||||
</v-layout>
|
||||
|
||||
<v-layout row wrap v-if="req_status != 'N'" class="pl-3 pr-3 pa-2">
|
||||
<v-flex xs6 v-for="(req, i) in requirements" v-bind:key="i" class="pt-0 pb-1 pr-1 pl-1">
|
||||
<v-btn color="black" block small outline class="ma-0 btn-req">{{req.label}}</v-btn>
|
||||
</v-flex>
|
||||
<!-- <v-card flat>
|
||||
<v-card-text class="pl-3 pr-3 pt-2 pb-2">
|
||||
<v-layout row wrap>
|
||||
|
||||
</v-layout>
|
||||
|
||||
</v-card-text>
|
||||
</v-card> -->
|
||||
</v-layout>
|
||||
|
||||
<v-container fluid v-if="req_status == 'N'" class="pl-2 pr-2 pt-2 pb-2">
|
||||
<v-layout row wrap>
|
||||
<!-- <one-field-verification v-for="req in requirements" :key="req.idx"
|
||||
@input="update_req"
|
||||
:value="req" class="xs12 sm10" >
|
||||
</one-field-verification> -->
|
||||
<v-flex xs12
|
||||
v-for="(req, i) in requirements"
|
||||
v-bind:key="i">
|
||||
|
||||
<v-checkbox
|
||||
color="#40a798"
|
||||
:value="req.req_id"
|
||||
:label="req.label"
|
||||
v-model="reqs"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
></v-checkbox>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-container>
|
||||
<v-divider></v-divider>
|
||||
<v-layout mb-2 row align-center>
|
||||
<v-flex xs6 pl-4 pt-2>
|
||||
<!-- <v-checkbox
|
||||
class="mt-0"
|
||||
color="#40a798"
|
||||
v-model="received_sample"
|
||||
style="font-size:12px"
|
||||
value="Y"
|
||||
hide-details
|
||||
></v-checkbox> -->
|
||||
<v-switch class="mt-0" color="#64b2cd" @change="received_sample.time === ''" hide-details v-model="received_sample.flag" value="Y" >
|
||||
<template v-slot:label>
|
||||
<span v-if="received_sample.flag === 'Y'" class="font-weight-black" style="color:#64b2cd;font-size:12px;">Hanya terima sample</span>
|
||||
<span v-if="received_sample.flag !== 'Y'" class="font-weight-black" style="font-size:12px;">Hanya terima sample</span>
|
||||
</template>
|
||||
</v-switch>
|
||||
</v-flex>
|
||||
<v-flex pr-2 pt-2 xs6>
|
||||
<v-text-field
|
||||
class="mt-2"
|
||||
v-model="received_sample.time"
|
||||
:label="`${label}`"
|
||||
mask="##-##-#### ##:##"
|
||||
@blur="checkFormatTime()"
|
||||
hide-details
|
||||
placeholder="dd-mm-yyyy hh:mm"
|
||||
v-if="received_sample.flag === 'Y'"
|
||||
outline
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
div.persyaratan input[type=text]::-webkit-input-placeholder {
|
||||
font-size: 1em;
|
||||
}
|
||||
div.persyaratan input[type=text] {
|
||||
font-size: .7em;
|
||||
}
|
||||
div.persyaratan label {
|
||||
color: #f44336!important;
|
||||
font-size: 1.1em;
|
||||
font-weight:400;
|
||||
}
|
||||
|
||||
.btn-req > .v-btn__content {
|
||||
justify-content: left !important
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
"one-field-verification" : httpVueLoader("./oneFieldVerification.vue")
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
cito_show : true,
|
||||
label:'Waktu Pengambilan Sample'
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
requirements(){
|
||||
return this.$store.state.px.requirement
|
||||
},
|
||||
|
||||
received_sample : {
|
||||
get () {
|
||||
return this.$store.state.order.received_sample
|
||||
},
|
||||
|
||||
set (v) {
|
||||
if (v == null){
|
||||
var vx = {}
|
||||
vx.flag = "N";
|
||||
vx.time = ''
|
||||
v = vx
|
||||
console.log(v)
|
||||
}
|
||||
|
||||
|
||||
this.$store.commit("order/update_received_sample", v)
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
appx_schedule() {
|
||||
return this.$store.state.px.appx_schedule
|
||||
},
|
||||
|
||||
req_status() {
|
||||
return this.$store.state.px.req_status
|
||||
},
|
||||
|
||||
req_text() {
|
||||
let x = []
|
||||
for (let i in this.requirements)
|
||||
x.push(this.requirements[i].label);
|
||||
|
||||
return x.join(', ')
|
||||
},
|
||||
|
||||
reqs : {
|
||||
get () { return this.$store.state.px.reqs },
|
||||
set (v) { this.$store.commit('px/update_reqs', v) }
|
||||
},
|
||||
|
||||
citos () {
|
||||
return this.$store.state.px.citos
|
||||
},
|
||||
|
||||
selected_cito : {
|
||||
get () { return this.$store.state.px.selected_cito },
|
||||
set (v) { this.$store.commit('px/update_selected_cito', v) }
|
||||
},
|
||||
|
||||
is_cito () {
|
||||
return this.$store.state.px.is_cito
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
update_req(val) {
|
||||
|
||||
let reqs = this.$store.state.px.requirement
|
||||
reqs.forEach(function(r,idx) {
|
||||
if ( val.idx = r.idx ) {
|
||||
reqs[idx] = val
|
||||
}
|
||||
})
|
||||
this.$store.commit("px/update_requirement", reqs)
|
||||
},
|
||||
|
||||
reqMe() {
|
||||
this.$store.commit('px/update_req_status', 'Y')
|
||||
},
|
||||
|
||||
reqMeNot() {
|
||||
this.$store.commit('px/update_req_status', 'N')
|
||||
},
|
||||
|
||||
checkFormatTime() {
|
||||
// Validasi format waktu (dd-mm-yyyy hh:mm)
|
||||
let timeValue = this.received_sample.time
|
||||
if (timeValue && timeValue.length === 16) {
|
||||
// Format: dd-mm-yyyy hh:mm
|
||||
let parts = timeValue.split(' ')
|
||||
if (parts.length === 2) {
|
||||
let datePart = parts[0] // dd-mm-yyyy
|
||||
let timePart = parts[1] // hh:mm
|
||||
|
||||
let dateParts = datePart.split('-')
|
||||
if (dateParts.length === 3) {
|
||||
// Validasi format sudah benar, tidak perlu mengubah karena konversi akan dilakukan di order.js
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$store.dispatch('px/search_cito')
|
||||
},
|
||||
|
||||
watch : {
|
||||
is_cito(val, old) {
|
||||
// if (val == "Y" && old == "N")
|
||||
// this.cito_show = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,118 @@
|
||||
<template>
|
||||
<v-layout row wrap >
|
||||
<v-flex xs12 sm6 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<patient-left-side></patient-left-side>
|
||||
<!-- <one-fo-registration-requirement></one-fo-registration-requirement> -->
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 sm6 class="right" fill-height pa-1>
|
||||
<!-- komponen kanan -->
|
||||
<patient-right-side></patient-right-side>
|
||||
</v-flex>
|
||||
<!-- <v-flex xs12 sm6 class="right" fill-height pa-1>
|
||||
komponen kanan
|
||||
<v-card class="pa-1">
|
||||
<v-layout column>
|
||||
<v-layout align-center row>
|
||||
<v-flex xs12>
|
||||
<v-card tile class="pa-2" flat color="#64b2cd">
|
||||
<h5 class="subtitle-1 font-weight-bold" style="color:#fff">DETAIL ORDER</h5>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout column>
|
||||
|
||||
<v-layout style="background:#89CFF0" mb-0 mt-1 align-center row>
|
||||
<v-flex v-if="!cito_show || is_cito !== 'Y'" xs2>
|
||||
|
||||
<h5 class="mono subtitle-1 pl-2 font-weight-bold">
|
||||
|
||||
</h5>
|
||||
|
||||
|
||||
</v-flex>
|
||||
<v-flex v-if="!cito_show || is_cito !== 'Y'" xs10 class="text-xs-right">
|
||||
<p class="mb-0 pb-1 pt-1 pr-1">
|
||||
<kbd class="mr-1" v-for="schedule in schedules">{{getTimeX(schedule)}}</kbd>
|
||||
</p>
|
||||
</v-flex>
|
||||
<v-flex v-if="cito_show && is_cito == 'Y'" xs2>
|
||||
<v-btn dark @click="dialog_cito = true" small color="#ee7777">{{selected_cito.Nat_CitoName}}</v-btn>
|
||||
<span class="font-weight-black caption" style="color:#6a6a6a">JANJI HASIL</span>
|
||||
|
||||
</v-flex>
|
||||
<v-flex v-if="cito_show && is_cito == 'Y'" xs10 class="text-xs-right">
|
||||
<p class="mb-0 pb-1 pt-1 pr-1">
|
||||
<kbd class="mr-1" v-for="schedule in schedules">{{getTimeX(schedule)}}</kbd>
|
||||
</p>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
|
||||
</v-layout>
|
||||
<one-fo-registration-price-list></one-fo-registration-price-list>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-flex> -->
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'patient-left-side' : httpVueLoader('./patientLeftSide.vue'),
|
||||
'patient-right-side' : httpVueLoader('./patientRightSide.vue'),
|
||||
'one-fo-registration-price-list' : httpVueLoader('./oneFoRegistrationPriceList.vue?ts='
|
||||
+ new Date().toISOString()),
|
||||
'one-fo-registration-requirement' : httpVueLoader('./oneFoRegistrationRequirement.vue')
|
||||
},
|
||||
computed: {
|
||||
schedules() {
|
||||
var xvar = this.$store.state.px.appx_schedule
|
||||
if(xvar)
|
||||
xvar = xvar.split(",")
|
||||
else
|
||||
xvar = []
|
||||
return xvar
|
||||
},
|
||||
citos () {
|
||||
return this.$store.state.px.citos
|
||||
},
|
||||
|
||||
selected_cito : {
|
||||
get () { return this.$store.state.px.selected_cito },
|
||||
set (v) { this.$store.commit('px/update_selected_cito', v) }
|
||||
},
|
||||
|
||||
is_cito () {
|
||||
return this.$store.state.px.is_cito
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTimeX(xtime) {
|
||||
if(xtime)
|
||||
return moment(xtime).format('DD-MM-YYYY HH:mm')
|
||||
else
|
||||
return
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
cito_show : true,
|
||||
dialog_cito:false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.$store.dispatch('px/search_cito')
|
||||
},
|
||||
|
||||
watch : {
|
||||
is_cito(val, old) {
|
||||
// if (val == "Y" && old == "N")
|
||||
// this.cito_show = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<v-layout row wrap>
|
||||
<v-dialog
|
||||
v-model="dialog_pop_up_error"
|
||||
width="500"
|
||||
>
|
||||
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2"
|
||||
primary-title
|
||||
>
|
||||
Pesan Error
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
{{message_error}}
|
||||
</v-card-text>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="primary"
|
||||
flat
|
||||
@click="dialog_pop_up_error = false"
|
||||
>
|
||||
Saya mengerti
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog
|
||||
v-model="dialog_cito"
|
||||
width="500"
|
||||
>
|
||||
|
||||
<v-card >
|
||||
<v-card-title
|
||||
class="subtitle-1"
|
||||
color="#64b2cd"
|
||||
>
|
||||
PILIH CITO
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<v-select
|
||||
:items="citos"
|
||||
item-text="Nat_CitoName"
|
||||
item-value="Nat_CitoID"
|
||||
return-object
|
||||
|
||||
hide-details
|
||||
dense
|
||||
v-model="selected_cito"
|
||||
height="30"
|
||||
v-show="cito_show && is_cito == 'Y'"
|
||||
class="mt-0 pt-0"
|
||||
append-icon="clear"
|
||||
@click:append="selected_cito = null"
|
||||
></v-select>
|
||||
</v-card-text>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="black"
|
||||
flat
|
||||
@click="dialog_cito = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-flex xs12 sm6 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-mou-px-left></one-mou-px-left>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 sm6 class="right" fill-height pa-1>
|
||||
<!-- komponen kanan -->
|
||||
<v-card class="pa-1">
|
||||
<v-layout column>
|
||||
<v-layout align-center row>
|
||||
<v-flex xs12>
|
||||
<v-card tile class="pa-2" flat color="#64b2cd">
|
||||
<h5 class="subtitle-1 font-weight-bold" style="color:#fff">DETAIL ORDER</h5>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout column>
|
||||
|
||||
<v-layout style="background:#89CFF0" mb-0 mt-1 align-center row>
|
||||
<v-flex v-if="!cito_show || is_cito !== 'Y'" xs2>
|
||||
|
||||
<h5 class="mono subtitle-1 pl-2 font-weight-bold">
|
||||
JANJI HASIL
|
||||
</h5>
|
||||
|
||||
|
||||
</v-flex>
|
||||
<v-flex v-if="!cito_show || is_cito !== 'Y'" xs10 class="text-xs-right">
|
||||
<p v-if="preregister_promise == ''" class="mb-0 pb-1 pt-1 pr-1">
|
||||
<span class="mr-1" v-for="schedule in appx_schedule_computed">
|
||||
<kbd v-if="schedule.ScheduleID">{{schedule.JanjiHasil}}</kbd>
|
||||
<code v-else>{{schedule.JanjiHasil}}</code>
|
||||
</span>
|
||||
</p>
|
||||
<p v-else class="mb-0 pb-1 pt-1 pr-1">
|
||||
<kbd class="mr-1">{{preregister_promise}}</kbd>
|
||||
</p>
|
||||
</v-flex>
|
||||
<v-flex v-if="cito_show && is_cito == 'Y'" xs2>
|
||||
<v-btn dark @click="dialog_cito = true" small color="#ee7777">{{selected_cito.Nat_CitoName}}</v-btn>
|
||||
<!--<span class="font-weight-black caption" style="color:#6a6a6a">JANJI HASIL</span>-->
|
||||
|
||||
</v-flex>
|
||||
<v-flex v-if="cito_show && is_cito == 'Y'" xs10 class="text-xs-right">
|
||||
<p class="mb-0 pb-1 pt-1 pr-1">
|
||||
<kbd class="mr-1" v-for="schedule in schedules">{{getTimeX(schedule)}}</kbd>
|
||||
</p>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
|
||||
</v-layout>
|
||||
<one-fo-registration-price-list></one-fo-registration-price-list>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</template>
|
||||
<style scoped>
|
||||
.mini-select .v-select__selections {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
flex-wrap: wrap;
|
||||
line-height: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-mou-px-left' : httpVueLoader('./oneMouPxLeft.vue'),
|
||||
'one-fo-registration-price-list' : httpVueLoader('./oneFoRegistrationPriceList.vue?ts='
|
||||
+ new Date().toISOString())
|
||||
},
|
||||
computed: {
|
||||
message_error() {
|
||||
return this.$store.state.order.message_error
|
||||
},
|
||||
dialog_pop_up_error : {
|
||||
get() {
|
||||
return this.$store.state.order.dialog_pop_up_error
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('order/update_dialog_pop_up_error', val)
|
||||
}
|
||||
},
|
||||
appx_schedule_computed() {
|
||||
return this.$store.state.px.appx_schedule
|
||||
},
|
||||
preregister_promise() {
|
||||
return this.$store.state.order.preregister_promise
|
||||
},
|
||||
schedules() {
|
||||
var xvar = this.$store.state.px.appx_schedule
|
||||
if(xvar)
|
||||
xvar = xvar.split(",")
|
||||
else
|
||||
xvar = []
|
||||
return xvar
|
||||
},
|
||||
citos () {
|
||||
return this.$store.state.px.citos
|
||||
},
|
||||
|
||||
selected_cito : {
|
||||
get () { return this.$store.state.px.selected_cito },
|
||||
set (v) { this.$store.commit('px/update_selected_cito', v) }
|
||||
},
|
||||
|
||||
is_cito () {
|
||||
return this.$store.state.px.is_cito
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTimeX(xtime) {
|
||||
if(xtime)
|
||||
return moment(xtime).format('DD-MM-YYYY HH:mm')
|
||||
else
|
||||
return
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
cito_show : true,
|
||||
dialog_cito:false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.$store.dispatch('px/search_cito')
|
||||
},
|
||||
|
||||
watch : {
|
||||
is_cito(val, old) {
|
||||
// if (val == "Y" && old == "N")
|
||||
// this.cito_show = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 sm6 class="left" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-fo-registration-detail-order></one-fo-registration-detail-order>
|
||||
</v-flex>
|
||||
|
||||
<v-flex xs12 sm6 class="right" fill-height pa-1>
|
||||
<!-- komponen kanan -->
|
||||
<one-fo-registration-payment></one-fo-registration-payment>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-fo-registration-detail-order' : httpVueLoader('./oneFoRegistrationDetailOrder.vue'),
|
||||
'one-fo-registration-payment' : httpVueLoader('./oneFoRegistrationPayment2.vue?ts='+Date.now())
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<v-layout column pb-2>
|
||||
<v-card class="search-test pa-1 mb-0">
|
||||
<!-- <v-card-actions>
|
||||
<v-btn flat :outline="isTab('px')" color="orange" @click="selectTab('px')" >Pemeriksaan</v-btn>
|
||||
<v-btn flat :outline="isTab('panel')" color="orange" @click="selectTab('panel')" >Panel</v-btn>
|
||||
<v-btn flat :outline="isTab('profile')" color="orange" @click="selectTab('profile')" >Profile</v-btn>
|
||||
<v-btn flat :outline="isTab('mou')" color="orange" text-color="red" @click="selectTab('mou')" >MOU *</v-btn>
|
||||
</v-card-actions> -->
|
||||
<v-divider></v-divider>
|
||||
<one-mou-px-mou-info v-if="isTab('mou')">
|
||||
</one-mou-px-mou-info>
|
||||
<one-mou-px-px v-if="isTab('px')">
|
||||
</one-mou-px-px>
|
||||
<one-mou-px-panel v-if="isTab('panel')">
|
||||
</one-mou-px-panel>
|
||||
<one-mou-px-profile v-if="isTab('profile')">
|
||||
</one-mou-px-profile >
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-mou-px-mou-info' : httpVueLoader('./oneMouPxMouInfo.vue'),
|
||||
'one-mou-px-px' : httpVueLoader('./oneMouPxPx.vue?ts' + new Date().toISOString() ),
|
||||
'one-mou-px-panel' : httpVueLoader('./oneMouPxPanel.vue'),
|
||||
'one-mou-px-profile' : httpVueLoader('./oneMouPxProfile.vue'),
|
||||
},
|
||||
methods: {
|
||||
isTab(tab) {
|
||||
return this.$store.state.company.selected_px_tab == tab
|
||||
},
|
||||
selectTab(tab) {
|
||||
let prev_tab = this.$store.state.company.selected_px_tab
|
||||
if (tab != this.$store.state.company.selected_px_tab ) {
|
||||
//reset panels tests profiles
|
||||
this.$store.commit('px/update_tests',[])
|
||||
this.$store.commit('px/update_panels',[])
|
||||
}
|
||||
this.$store.commit('company/update_selected_px_tab',tab)
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
selected_px_tab() {
|
||||
return this.$store.state.company.selected_px_tab
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialog_start" fullscreen persistense hide-overlay transition="dialog-bottom-transition">
|
||||
<v-card>
|
||||
<v-toolbar dark color="primary">
|
||||
<v-btn icon dark @click="dialog = false">
|
||||
<v-icon>close</v-icon>
|
||||
</v-btn>
|
||||
<v-toolbar-title>Settings</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-toolbar-items>
|
||||
<v-btn dark flat @click="dialog = false">Save</v-btn>
|
||||
</v-toolbar-items>
|
||||
</v-toolbar>
|
||||
<v-list three-line subheader>
|
||||
<v-subheader>User Controls</v-subheader>
|
||||
<v-list-tile avatar>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>Content filtering</v-list-tile-title>
|
||||
<v-list-tile-sub-title>Set the content filtering level to restrict apps that can be downloaded</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
<v-list-tile avatar>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>Password</v-list-tile-title>
|
||||
<v-list-tile-sub-title>Require password for purchase or use password to restrict purchase</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
<v-divider></v-divider>
|
||||
<v-list three-line subheader>
|
||||
<v-subheader>General</v-subheader>
|
||||
<v-list-tile avatar>
|
||||
<v-list-tile-action>
|
||||
<v-checkbox v-model="notifications"></v-checkbox>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>Notifications</v-list-tile-title>
|
||||
<v-list-tile-sub-title>Notify me about updates to apps or games that I downloaded</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
<v-list-tile avatar>
|
||||
<v-list-tile-action>
|
||||
<v-checkbox v-model="sound"></v-checkbox>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>Sound</v-list-tile-title>
|
||||
<v-list-tile-sub-title>Auto-update apps at any time. Data charges may apply</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
<v-list-tile avatar>
|
||||
<v-list-tile-action>
|
||||
<v-checkbox v-model="widgets"></v-checkbox>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>Auto-add widgets</v-list-tile-title>
|
||||
<v-list-tile-sub-title>Automatically add home screen widgets</v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
table.v-table tbody td,table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.one-btn-icon { font-size: 1.5em; float: right }
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
computed : {
|
||||
dialog_start: {
|
||||
get() {
|
||||
return this.$store.state.order.dialog_start
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('order/update_dialog_start',val)
|
||||
}
|
||||
},
|
||||
status_start: {
|
||||
get() {
|
||||
return this.$store.state.order.status_start
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('order/update_status_start',val)
|
||||
}
|
||||
},
|
||||
time_start: {
|
||||
get() {
|
||||
return this.$store.state.order.time_start
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('order/update_time_start',val)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
|
||||
methods : {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<v-layout column>
|
||||
<one-fo-registration-company></one-fo-registration-company>
|
||||
<one-fo-registration-test></one-fo-registration-test>
|
||||
<one-fo-registration-requirement></one-fo-registration-requirement>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'one-fo-registration-company' : httpVueLoader('./oneFoRegistrationCompany.vue?ts=' + new Date().toISOString() ),
|
||||
'one-fo-registration-test' : httpVueLoader('./oneFoRegistrationTest.vue?ts=' + new Date().toISOString() ),
|
||||
'one-fo-registration-requirement' : httpVueLoader('./oneFoRegistrationRequirement.vue?ts=' + new Date().toISOString() )
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<v-card-text class="pa-0">
|
||||
<v-layout align-center row>
|
||||
<v-flex xs12>
|
||||
<v-card tile class="pa-2" flat color="#64b2cd">
|
||||
<h5 class="subtitle-1 font-weight-bold">KEL. PELANGGAN DAN AGREEMENT</h5>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<div v-if="!mou.M_MouCompanyName">
|
||||
Belum ada agreement yang di pilih
|
||||
</div>
|
||||
<div v-if="mou.M_MouCompanyName">
|
||||
Agreement : {{mou.M_MouCompanyName}} <br/>
|
||||
Start : {{mou.M_MouCompanyStartDate}} <br/>
|
||||
End : {{mou.M_MouCompanyEndDate}} <br/>
|
||||
Note : {{mou.M_MouCompanyNote}} <br/>
|
||||
</div>
|
||||
</v-card-text>
|
||||
</template>
|
||||
<script>
|
||||
module.exports = {
|
||||
computed : {
|
||||
mou() {
|
||||
return this.$store.state.company.selected_mou
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<v-card-text>
|
||||
<v-layout row >
|
||||
<v-flex xs6 class="pa-0 ma-0" >
|
||||
<v-text-field
|
||||
label="Panel"
|
||||
placeholder="Cari Panel"
|
||||
@change="search"
|
||||
class="ma-0"
|
||||
outline
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6 class="pa-3">
|
||||
<v-label >
|
||||
Panel found {{panel_count}}, display {{ panel_count < 20 ? panel_count : 20 }}
|
||||
</v-label>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-container grid-list-xs text-xs-center pa-0>
|
||||
<v-layout row wrap>
|
||||
<v-btn xs3 v-for="p in panels" :key="p.T_TestPanelID"
|
||||
@click="selectPanel(p)"
|
||||
depressed small color="error">
|
||||
{{p.T_TestPanelName}}
|
||||
</v-btn>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</template>
|
||||
<script>
|
||||
module.exports = {
|
||||
methods: {
|
||||
search(val) {
|
||||
if (this.prev_val == val ) return
|
||||
this.prev_val = val
|
||||
this.$store.commit("px/update_search_panel",val)
|
||||
this.$store.dispatch("px/panel")
|
||||
},
|
||||
update_req(px) {
|
||||
if (px.T_TestRequirement != '' ) {
|
||||
let reqs = this.$store.state.px.requirement
|
||||
if (! _.find(reqs, function(r) { return r.label == px.T_TestRequirement; }) ) {
|
||||
reqs.push({
|
||||
label: px.T_TestRequirement,
|
||||
is_error: true,
|
||||
checked : false,
|
||||
error_message: 'Hasil harus di isi',
|
||||
note: ''
|
||||
})
|
||||
}
|
||||
this.$store.commit('px/update_requirement',reqs)
|
||||
}
|
||||
},
|
||||
selectPanel(panel) {
|
||||
try {
|
||||
let selected_panel = this.$store.state.px.selected_panel
|
||||
let flag_found = false
|
||||
selected_panel.forEach( function(p,idx) {
|
||||
if (panel.T_TestPanelID == p.T_TestPanelID) {
|
||||
selected_panel[idx] = panel
|
||||
flag_found = true
|
||||
}
|
||||
})
|
||||
if (!flag_found) {
|
||||
let f_update_req = this.update_req
|
||||
selected_panel.push(panel)
|
||||
panel.test.forEach(function(px){
|
||||
f_update_req(px)
|
||||
})
|
||||
}
|
||||
this.$store.commit('px/update_selected_panel',selected_panel)
|
||||
let panels = this.$store.state.px.panels
|
||||
let p_idx= -1
|
||||
panels.forEach( function(p,idx) {
|
||||
if (p.T_TestPanelID == panel.T_TestPanelID) p_idx = idx
|
||||
})
|
||||
if (p_idx >= 0 ) {
|
||||
_.pullAt(panels,[p_idx])
|
||||
let dt = {
|
||||
records: panels,
|
||||
total : panels.length
|
||||
}
|
||||
this.$store.commit('px/update_panels',dt)
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
panel_count() {
|
||||
return this.$store.state.px.total_panel
|
||||
},
|
||||
panels() {
|
||||
console.log('get panels')
|
||||
return this.$store.state.px.panels
|
||||
},
|
||||
is_loading() {
|
||||
return this.$store.state.px.search_panel_status == 1
|
||||
}
|
||||
},
|
||||
data: function(){
|
||||
return {
|
||||
prev_val: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,220 @@
|
||||
|
||||
<template>
|
||||
<v-card-text>
|
||||
<v-layout row >
|
||||
<v-text-field
|
||||
placeholder="ketikkan profile..."
|
||||
class="pt-0"
|
||||
v-model="search"
|
||||
@keyup.enter="do_search"
|
||||
>
|
||||
</v-text-field>
|
||||
</v-layout>
|
||||
<v-layout row wrap>
|
||||
|
||||
<v-flex xs3 v-for="(profile, idx) in profiles" v-bind:key="idx">
|
||||
<v-layout row>
|
||||
<v-flex>
|
||||
<v-btn depressed small color="error" class="mr-0 btn-profile" :disabled="profile.err > 0" :dark="profile.err < 1" block @click="selectPx(profile.detail)">{{ profile.T_ProfileName }}</v-btn>
|
||||
</v-flex>
|
||||
<v-flex>
|
||||
<v-btn depressed small icon color="red lighten-2" dark class="ml-0" @click="profile_detail(profile)"><v-icon>search</v-icon></v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
|
||||
</v-flex>
|
||||
|
||||
<v-snackbar
|
||||
v-model="snackbar"
|
||||
top
|
||||
>
|
||||
{{ err_text }}
|
||||
<v-btn color="red" flat @click="snackbar = false" >
|
||||
Close
|
||||
</v-btn>
|
||||
</v-snackbar>
|
||||
|
||||
<v-dialog
|
||||
v-model="profile_detail_dialog"
|
||||
width="500"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2"
|
||||
primary-title
|
||||
>
|
||||
{{ profile_detail_title }}
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs6 v-for="(px, i) in profile_detail_px" v-bind:key="i" pa-1>
|
||||
<v-btn color="orange" block dark>{{ px.T_TestName }}</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
|
||||
<v-btn
|
||||
color="primary"
|
||||
flat
|
||||
@click="profile_detail_dialog = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="red" dark>Tambahkan ke Order</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
</template>
|
||||
<style scoped>
|
||||
.v-btn--icon {
|
||||
border-radius: 0px
|
||||
}
|
||||
|
||||
.btn-profile {
|
||||
border-top-right-radius: 0%;
|
||||
border-bottom-right-radius: 0%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data () {
|
||||
return {
|
||||
snackbar: false,
|
||||
err_text: "",
|
||||
|
||||
profile_detail_dialog: false,
|
||||
profile_detail_text: '',
|
||||
profile_detail_title: 'SGPT',
|
||||
|
||||
profile_detail_px: []
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
profiles () {
|
||||
return this.$store.state.px.profiles
|
||||
},
|
||||
|
||||
search : {
|
||||
get () {
|
||||
return this.$store.state.px.search_profile
|
||||
},
|
||||
set (v) {
|
||||
this.$store.commit('px/update_search_profile', v)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
do_search() {
|
||||
this.$store.dispatch('px/profile')
|
||||
},
|
||||
|
||||
selectPx(pxs) {
|
||||
let flag_found = false
|
||||
let flag_name = ""
|
||||
let selected_test = this.$store.state.px.selected_test
|
||||
|
||||
for (let i in pxs) {
|
||||
var px = pxs[i]
|
||||
selected_test.forEach( function(t, idx) {
|
||||
if (t.T_TestID == px.T_TestID) {
|
||||
flag_found = true
|
||||
flag_name = t.T_TestName
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (flag_found) {
|
||||
this.err_text = "Tidak bisa menambahkan Profile. Pemeriksaan " + flag_name + " sudah ada !"
|
||||
this.snackbar = true
|
||||
return
|
||||
}
|
||||
|
||||
for (let i in pxs) {
|
||||
var px = pxs[i]
|
||||
|
||||
try {
|
||||
// if (in_selectPx) return
|
||||
// in_selectPx = true
|
||||
|
||||
// let selected_test = this.$store.state.px.selected_test
|
||||
flag_found = false
|
||||
// let flag_found = false
|
||||
// selected_test.forEach( function(t, idx) {
|
||||
// if (t.T_TestID == px.T_TestID) {
|
||||
// selected_test[idx] = px
|
||||
// flag_found = true
|
||||
// }
|
||||
// })
|
||||
|
||||
if (!flag_found) {
|
||||
selected_test.push(px)
|
||||
|
||||
// let tests = this.$store.state.px.tests
|
||||
// let p_idx = -1
|
||||
// tests.forEach(function(t,idx) {
|
||||
// if (t.T_TestID == px.T_TestID) {
|
||||
// p_idx = idx
|
||||
// }
|
||||
// })
|
||||
// if (p_idx >= 0 ) {
|
||||
// _.pullAt(tests,[p_idx])
|
||||
// let dt = {
|
||||
// records: tests,
|
||||
// total: tests.length
|
||||
// }
|
||||
// this.$store.commit('px/update_tests',dt)
|
||||
// }
|
||||
}
|
||||
|
||||
this.$store.commit('px/update_selected_test', selected_test)
|
||||
if (px.T_TestRequirement != '' ) {
|
||||
let reqs = this.$store.state.px.requirement
|
||||
let rst = _.find(reqs, function(r) { return r.label == px.T_TestRequirement; })
|
||||
if ( rst == undefined ) {
|
||||
reqs.push({
|
||||
px_id: px.T_TestID,
|
||||
label: px.T_TestRequirement,
|
||||
error_message: 'Hasil harus di isi',
|
||||
is_error: true,
|
||||
checked : false,
|
||||
note: ''
|
||||
})
|
||||
}
|
||||
|
||||
this.$store.commit('px/update_requirement', reqs)
|
||||
|
||||
// Update Janji Hasil
|
||||
this.$store.dispatch('px/appx_schedule')
|
||||
}
|
||||
|
||||
// in_selectPx = false
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
// in_selectPx = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
profile_detail (profile) {
|
||||
this.profile_detail_title = profile.T_ProfileName
|
||||
this.profile_detail_text = JSON.stringify(profile.detail)
|
||||
this.profile_detail_px = profile.detail
|
||||
this.profile_detail_dialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<v-card-text class="pa-0">
|
||||
<v-layout column>
|
||||
<v-layout align-center row>
|
||||
<v-flex xs12>
|
||||
<v-card tile class="pa-2" flat color="#64b2cd">
|
||||
<h5 style="color:#fff" class="subtitle-1 font-weight-bold">PEMERIKSAAN</h5>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout mt-1 align-row row>
|
||||
<v-flex xs12 class="pl-1 pt-1 pr-1 ma-0" >
|
||||
<v-text-field
|
||||
placeholder="Ketikkan pemeriksaan ..."
|
||||
@change="search"
|
||||
class="ma-0"
|
||||
single-line
|
||||
clearable
|
||||
outline
|
||||
hide-details
|
||||
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
<v-layout row >
|
||||
<v-flex xs6 pl-1 pr-1>
|
||||
<p class="mb-0 mt-2 mono caption">Tekan <kbd>enter</kbd> untuk memulai pencarian</p>
|
||||
</v-flex>
|
||||
<v-flex xs6 pl-1 pr-1 >
|
||||
<!--<p class="mb-0 pa-1 text-xs-right caption">
|
||||
<v-icon small>search</v-icon> Ditemukan data sebanyak <kbd style="background:#64b2cd">{{test_count}}</kbd> pemeriksaan
|
||||
</p>-->
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider class="mt-2 mb-2"></v-divider>
|
||||
<v-progress-linear class="ma-0 pa-0" indeterminate :active="is_loading" color="primary" />
|
||||
</v-layout>
|
||||
<v-layout pl-1 pr-1 row wrap>
|
||||
<v-flex xs6 v-for="test in tests" v-if="!selected_test(test)" :key="test.T_TestPriceID">
|
||||
<!--<v-btn block
|
||||
|
||||
@click="selectPx(test)"
|
||||
depressed small :color="px_color(test.px_type)" dark
|
||||
outline
|
||||
class="ma-0 btn-px"
|
||||
|
||||
>
|
||||
{{test.T_TestName}}
|
||||
</v-btn> -->
|
||||
<v-layout style="cursor:pointer" align-center @click="selectPx(test)" row>
|
||||
<v-flex xs12>
|
||||
<v-card v-if="test.px_type !== 'PN' && test.px_type !== 'PR'" color="#ee7777" dark class="pa-2 ma-1" >
|
||||
<p class="mb-0 caption">{{test.code}} | {{test.T_TestName}}</p>
|
||||
</v-card>
|
||||
<v-card v-if="test.px_type === 'PN'" color="#40a798" dark class="pa-2 ma-1" >
|
||||
<p class="mb-0 caption">{{test.code}} | {{test.T_TestName}}</p>
|
||||
</v-card>
|
||||
<v-card v-if="test.px_type === 'PR'" color="#7c73e6" dark class="pa-2 ma-1" >
|
||||
<p class="mb-0 caption">{{test.code}} | {{test.T_TestName}}</p>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
<v-divider class="mt-4 mb-2"></v-divider>
|
||||
</v-card-text>
|
||||
</template>
|
||||
<style scoped>
|
||||
.btn-px > .v-btn__content {
|
||||
justify-content: left !important
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
let in_selectPx = false
|
||||
module.exports = {
|
||||
methods: {
|
||||
selected_test(x_px){
|
||||
var nat_tests = this.$store.state.px.nat_test
|
||||
var found_nt = false
|
||||
x_px.nat_test.forEach(function(entry) {
|
||||
if (nat_tests.indexOf(entry) !== -1)
|
||||
found_nt = true
|
||||
})
|
||||
return found_nt
|
||||
},
|
||||
search(val) {
|
||||
if ( val == this.prev_search ) return
|
||||
console.log('Searching',val)
|
||||
this.prev_search = val
|
||||
this.$store.commit("px/update_search",val)
|
||||
this.$store.dispatch("px/search")
|
||||
},
|
||||
keyup(e) {
|
||||
//this.showhint = true
|
||||
if (e.which==13) {
|
||||
if (!window.one_token()) {
|
||||
this.$store.commit('update_message_error', 'Maaf, koneksi Anda sempat terputus silahkan Log Out dan Login kembali')
|
||||
this.$store.commit('update_dialog_error', true)
|
||||
return
|
||||
}
|
||||
|
||||
//this.$store.commit('patient/update_current_page',1)
|
||||
if ( this.search == this.prev_search ) return
|
||||
console.log('Searching',this.search)
|
||||
this.prev_search = this.search
|
||||
in_selectPx = false
|
||||
console.log(in_selectPx)
|
||||
//this.$store.commit("px/update_search",val)
|
||||
this.$store.dispatch("px/search")
|
||||
}
|
||||
},
|
||||
|
||||
async selectPx(px) {
|
||||
console.log(px)
|
||||
//debugger
|
||||
console.log("start select px")
|
||||
if (!window.one_token()) {
|
||||
this.$store.commit('update_message_error', 'Maaf, koneksi Anda sempat terputus silahkan Log Out dan Login kembali')
|
||||
this.$store.commit('update_dialog_error', true)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
console.log(in_selectPx)
|
||||
// START LOADING
|
||||
this.$store.commit('update_dialog_loading', true)
|
||||
|
||||
// IF PROFILE
|
||||
if (px.px_type == "PR" || px.px_type == "PXR" || px.px_type == "PN")
|
||||
return await this.selectProfile(px)
|
||||
|
||||
// SEARCH NAT TEST
|
||||
let nt = this.$store.state.px.nat_test
|
||||
let found_nt = false
|
||||
for (let i in px.nat_test) {
|
||||
if (nt.indexOf(px.nat_test[i]) > -1)
|
||||
found_nt = true
|
||||
}
|
||||
|
||||
if (found_nt) {
|
||||
alert('Pemeriksaan tersebut sudah ada !')
|
||||
// END LOADING
|
||||
this.$store.commit('update_dialog_loading', false)
|
||||
return
|
||||
}
|
||||
|
||||
//if (in_selectPx) return
|
||||
in_selectPx = true
|
||||
let selected_test = this.selected_test_computed
|
||||
let flag_found = false
|
||||
selected_test.forEach( function(t,idx) {
|
||||
if (t.T_TestID == px.T_TestID) {
|
||||
selected_test[idx] = px
|
||||
flag_found = true
|
||||
}
|
||||
})
|
||||
if (!flag_found) {
|
||||
selected_test.push(px)
|
||||
let tests = this.$store.state.px.tests
|
||||
let p_idx = -1
|
||||
tests.forEach(function(t,idx) {
|
||||
if (t.T_TestID == px.T_TestID) {
|
||||
p_idx = idx
|
||||
}
|
||||
})
|
||||
if (p_idx >= 0 ) {
|
||||
_.pullAt(tests,[p_idx])
|
||||
let dt = {
|
||||
records: tests,
|
||||
total: tests.length
|
||||
}
|
||||
this.$store.commit('px/update_tests',dt)
|
||||
}
|
||||
}
|
||||
this.selected_test_computed = selected_test
|
||||
|
||||
await this.processPxRequirements(px)
|
||||
|
||||
|
||||
|
||||
this.$store.dispatch('px/appx_schedule')
|
||||
|
||||
in_selectPx = false
|
||||
this.$store.commit('px/update_nat_test')
|
||||
|
||||
// END LOADING
|
||||
if (px.px_type == "PN")
|
||||
this.$store.dispatch('px/packet_reqs',{pxs:px.child_test})
|
||||
this.$store.commit('update_dialog_loading', false)
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
in_selectPx = false
|
||||
}
|
||||
},
|
||||
|
||||
async selectProfile(px) {
|
||||
try {
|
||||
|
||||
// SEARCH NAT TEST
|
||||
let nt = this.$store.state.px.nat_test
|
||||
let found_nt = false
|
||||
for (let i in px.nat_test) {
|
||||
if (nt.indexOf(px.nat_test[i]) > -1)
|
||||
found_nt = true
|
||||
}
|
||||
|
||||
if (found_nt) {
|
||||
alert('Pemeriksaan tersebut sudah ada !')
|
||||
// END LOADING
|
||||
this.$store.commit('update_dialog_loading', false)
|
||||
return
|
||||
}
|
||||
|
||||
let pxs = px.child_test
|
||||
|
||||
for (let i in pxs) {
|
||||
px = pxs[i]
|
||||
|
||||
let selected_test = this.selected_test_computed
|
||||
let flag_found = false
|
||||
|
||||
selected_test.push(px)
|
||||
let tests = this.$store.state.px.tests
|
||||
let p_idx = -1
|
||||
tests.forEach(function(t,idx) {
|
||||
if (t.T_TestID == px.T_TestID) {
|
||||
p_idx = idx
|
||||
}
|
||||
})
|
||||
|
||||
if (p_idx >= 0 ) {
|
||||
_.pullAt(tests,[p_idx])
|
||||
let dt = {
|
||||
records: tests,
|
||||
total: tests.length
|
||||
}
|
||||
this.$store.commit('px/update_tests',dt)
|
||||
}
|
||||
|
||||
this.selected_test_computed = selected_test
|
||||
|
||||
await this.processPxRequirements(px)
|
||||
}
|
||||
|
||||
this.$store.dispatch('px/appx_schedule')
|
||||
in_selectPx = false
|
||||
this.$store.commit('px/update_nat_test')
|
||||
|
||||
// END LOADING
|
||||
this.$store.commit('update_dialog_loading', false)
|
||||
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
// END LOADING
|
||||
this.$store.commit('update_dialog_loading', false)
|
||||
in_selectPx = false
|
||||
}
|
||||
},
|
||||
|
||||
async processPxRequirements(px) {
|
||||
// Ambil requirement dari BE jika belum ada atau kosong
|
||||
let req = px.requirement
|
||||
if (!req || req.length === 0) {
|
||||
req = await this.$store.dispatch('px/get_requirement', px.T_TestID)
|
||||
}
|
||||
|
||||
let reqs = this.$store.state.px.requirement
|
||||
if (req && req.length > 0) {
|
||||
for(let i in req) {
|
||||
let found = false
|
||||
for(let j in reqs) {
|
||||
if (reqs[j]['req_id'] == req[i]['req_id'])
|
||||
found = j
|
||||
}
|
||||
|
||||
if (!found)
|
||||
reqs.push({
|
||||
px_id: [px.T_TestID],
|
||||
label: req[i]['req_name'],
|
||||
error_message: 'Hasil harus di isi',
|
||||
is_error: true,
|
||||
checked : false,
|
||||
note: '',
|
||||
req_id: req[i]['req_id']
|
||||
})
|
||||
else
|
||||
reqs[found].px_id.push(px.T_TestID)
|
||||
}
|
||||
|
||||
this.$store.commit('px/update_requirement', reqs)
|
||||
}
|
||||
},
|
||||
|
||||
px_color (x) {
|
||||
if (x == "PR")
|
||||
return "green"
|
||||
else if (x == "PN")
|
||||
return "orange"
|
||||
else
|
||||
return "error"
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selected_test_computed : {
|
||||
get() {
|
||||
return this.$store.state.px.selected_test
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('px/update_selected_test', val)
|
||||
//this.$store.dispatch('px/get_promise_by_pxs', val)
|
||||
}
|
||||
},
|
||||
test_count() {
|
||||
return this.$store.state.px.total_test
|
||||
},
|
||||
display_count() {
|
||||
return this.tests.length
|
||||
},
|
||||
tests() {
|
||||
return this.$store.state.px.tests
|
||||
},
|
||||
is_selectPx() {
|
||||
return in_selectPx
|
||||
},
|
||||
is_loading() {
|
||||
return this.$store.state.px.search_status == 1
|
||||
}
|
||||
},
|
||||
data: function(){
|
||||
return {
|
||||
search_val:false,
|
||||
search_flag:false,
|
||||
prev_search : ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,185 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--<v-layout>
|
||||
<v-flex xs12 text-xs-center mb-2>
|
||||
<v-card color="blue lighten-4">
|
||||
<v-card-text class="pb-0 pt-1">
|
||||
<v-btn
|
||||
v-for="tab in tabs"
|
||||
:color="tab.code == active ? 'black' : 'grey lighten-5'"
|
||||
class="black--text ma-0 tab-btn"
|
||||
:class="[tab.code == active ? 'active' : '']"
|
||||
@click="changeTab(tab.code)"
|
||||
flat
|
||||
:key="tab.code"
|
||||
:data="tab"
|
||||
:disabled="!tab.enabled"
|
||||
>
|
||||
<h6 class="title">{{ tab.label }}</h6>
|
||||
</v-btn>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>-->
|
||||
<v-layout mt-0 v-if="active == '01'" row>
|
||||
<v-flex ml-1 mr-1 mb-1 xs12>
|
||||
<v-card color="teal lighten-3">
|
||||
<v-layout row>
|
||||
<v-flex ml-2 mt-1 mr-1 mb-1 xs6>
|
||||
<v-btn block
|
||||
depressed
|
||||
@click="changeTab('01')"
|
||||
class="font-weight-black text-mono"
|
||||
style="color:#fff!important"
|
||||
color="teal lighten-2">
|
||||
DEMOGRAFI
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-flex ml-1 mt-1 mr-1 mb-1 xs6>
|
||||
<v-btn block
|
||||
flat
|
||||
@click="changeTab('02')"
|
||||
class="font-weight-black text-mono"
|
||||
style="background:#fff!important"
|
||||
color="#3c70a4">
|
||||
PEMERIKSAAN
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<!-- <v-flex ml-1 mt-1 mr-2 mb-1 xs4>
|
||||
<v-btn block
|
||||
flat
|
||||
style="background:#fff!important"
|
||||
|
||||
class="font-weight-black text-mono"
|
||||
color="#9e9e9e">
|
||||
PEMBAYARAN
|
||||
</v-btn>
|
||||
</v-flex> -->
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout mt-0 v-if="active == '02'" row>
|
||||
<v-flex ml-1 mr-1 mb-1 xs12>
|
||||
<v-card color="#64b2cd">
|
||||
<v-layout row>
|
||||
<v-flex ml-2 mt-1 mr-1 mb-1 xs6>
|
||||
<v-btn block
|
||||
depressed
|
||||
flat
|
||||
@click="changeTab('01')"
|
||||
style="background:#fff!important"
|
||||
class="font-weight-black text-mono"
|
||||
color="teal">
|
||||
DEMOGRAFI
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-flex ml-1 mt-1 mr-1 mb-1 xs6>
|
||||
<v-btn block
|
||||
depressed
|
||||
@click="changeTab('02')"
|
||||
class="font-weight-black text-mono"
|
||||
style="color:#fff!important"
|
||||
color="#3c70a4">
|
||||
PEMERIKSAAN
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<!-- <v-flex ml-1 mt-1 mr-2 mb-1 xs4>
|
||||
<v-btn block
|
||||
depressed
|
||||
flat
|
||||
|
||||
style="background:#fff!important"
|
||||
class="font-weight-black text-mono"
|
||||
color="#9e9e9e">
|
||||
PEMBAYARAN
|
||||
</v-btn>
|
||||
</v-flex> -->
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout mt-0 v-if="active == '03'" row>
|
||||
<v-flex ml-1 mr-1 mb-1 xs12>
|
||||
<v-card color="#ffeaa5">
|
||||
<v-layout row>
|
||||
<v-flex ml-2 mt-1 mr-1 mb-1 xs6>
|
||||
<v-btn block
|
||||
depressed
|
||||
flat
|
||||
style="background:#fff!important"
|
||||
|
||||
class="font-weight-black text-mono"
|
||||
color="#9e9e9e">
|
||||
DEMOGRAFI
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-flex ml-1 mt-1 mr-1 mb-1 xs6>
|
||||
<v-btn block
|
||||
depressed
|
||||
flat
|
||||
style="background:#fff!important"
|
||||
|
||||
class="font-weight-black text-mono"
|
||||
color="#9e9e9e">
|
||||
PEMERIKSAAN
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<!-- <v-flex ml-1 mt-1 mr-2 mb-1 xs4>
|
||||
<v-btn block
|
||||
depressed
|
||||
@click="changeTab('03')"
|
||||
style="color:#fff!important"
|
||||
class="font-weight-black text-mono"
|
||||
color="#e16262">
|
||||
PEMBAYARAN
|
||||
</v-btn>
|
||||
</v-flex> -->
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.active {
|
||||
border-bottom: solid 7px #000066!important;
|
||||
}
|
||||
|
||||
.tab-btn {
|
||||
min-width: 400px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
changeTab (x) {
|
||||
// this.active = x;
|
||||
this.$store.commit('change_tab', x);
|
||||
}
|
||||
},
|
||||
|
||||
computed : {
|
||||
tabs : {
|
||||
get () {
|
||||
return this.$store.state.order.tabs
|
||||
},
|
||||
set (v) {
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
active () {
|
||||
return this.$store.state.tab_active
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<v-layout row justify-center>
|
||||
<v-dialog v-model="dialog_national" persistent :width="width_screen" hide-overlay transition="dialog-bottom-transition">
|
||||
|
||||
|
||||
<div class="view" :style="{'min-height':height_screen}">
|
||||
<div class="wrapper">
|
||||
<table :style="{'height':height_screen}" style="background:white" class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="sticky-col first-col">Nama</th>
|
||||
<th width="150px">No. Identitas</th>
|
||||
<th width="100px">Jenis kelamin</th>
|
||||
<th width="180px">Tempat Lahir</th>
|
||||
<th width="150px">Tanggal Lahir</th>
|
||||
<th width="100px">Agama</th>
|
||||
<th width="150px">No. HP</th>
|
||||
<th width="150px">Email</th>
|
||||
<th width="150px">Pekerjaan</th>
|
||||
<th width="150px">No Induk Pegawai</th>
|
||||
<th width="150px">Jabatan</th>
|
||||
<th width="150px">Kedudukan</th>
|
||||
<th width="150px">Penanggung Jawab</th>
|
||||
<th width="150px">Lokasi</th>
|
||||
<th width="200px">Catatan</th>
|
||||
<th width="350px">Alamat</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="patient in patients">
|
||||
<td class="sticky-col first-col">
|
||||
<p><span v-if="patient.M_PatientPrefix">{{patient.M_PatientPrefix}}</span> <span v-if="patient.M_PatientName">{{patient.M_PatientName}}</span> <span v-if="patient.M_PatientSuffix">{{patient.M_PatientSuffix}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_IdTypeName">{{patient.M_IdTypeName}}</span> <span v-if="patient.M_PatientIDNumber">{{patient.M_PatientIDNumber}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_SexName">{{patient.M_SexName}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_PatientPOB">{{patient.M_PatientPOB}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_PatientDOB">{{patient.M_PatientDOB}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_ReligionName">{{patient.M_ReligionName}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_PatientHP">{{patient.M_PatientHP}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_PatientEmail">{{patient.M_PatientEmail}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_PatientJob">{{patient.M_PatientJob}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_PatientNIK">{{patient.M_PatientNIK}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_PatientJabatan">{{patient.M_PatientJabatan}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_PatientKedudukan">{{patient.M_PatientKedudukan}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_PatientPJ">{{patient.M_PatientPJ}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_PatientLocation">{{patient.M_PatientLocation}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><span v-if="patient.M_PatientNote">{{patient.M_PatientNote}}</span></p>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</v-dialog>
|
||||
</v-layout>
|
||||
</template>
|
||||
<style scoped>
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
th, td {
|
||||
text-align: left;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
tr:nth-child(even) {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
.view {
|
||||
margin: auto;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
border: 1px solid black;
|
||||
white-space: nowrap;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.sticky-col {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
background-color: grey !important;
|
||||
color:white;
|
||||
}
|
||||
|
||||
.first-col {
|
||||
width: 100px;
|
||||
min-width: 100px;
|
||||
max-width: 100px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.second-col {
|
||||
width: 150px;
|
||||
min-width: 150px;
|
||||
max-width: 150px;
|
||||
left: 100px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
//'patient-search-box' : httpVueLoader('./patientSearchBox.vue'),
|
||||
// 'patient-detail': httpVueLoader('./patientDetail.vue'),
|
||||
// 'patient-notes' : httpVueLoader('./patientNotes.vue'),
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
width_screen : screen.width+' px',
|
||||
height_screen : screen.height+' px',
|
||||
patients:[
|
||||
{
|
||||
"M_PatientID": "874247",
|
||||
"M_PatientNoReg": "LAB0069899",
|
||||
"M_PatientPrefix": null,
|
||||
"M_PatientName": "DENNY HANDOYO",
|
||||
"M_PatientSuffix": null,
|
||||
"M_PatientHP": "082333349448",
|
||||
"M_PatientEmail": "",
|
||||
"M_PatientPOB": "SURABAYA",
|
||||
"M_PatientPhone": "",
|
||||
"M_PatientIDNumber": "3578170804790005",
|
||||
"M_PatientDOB": "08-04-1979",
|
||||
"M_PatientNote": "",
|
||||
"M_PatientNIK": null,
|
||||
"M_PatientJabatan": null,
|
||||
"M_PatientKedudukan": null,
|
||||
"M_PatientPJ": null,
|
||||
"M_PatientLocation": null,
|
||||
"M_PatientJob": null,
|
||||
"M_PatientM_SexID": "1",
|
||||
"M_SexName": "Laki - Laki ",
|
||||
"M_PatientM_TitleID": "2",
|
||||
"M_TitleName": "Tn",
|
||||
"M_PatientM_ReligionID": "0",
|
||||
"M_ReligionName": null,
|
||||
"M_PatientM_IdTypeID": "1",
|
||||
"M_IdTypeName": "KTP",
|
||||
"status": "active"
|
||||
},
|
||||
{
|
||||
"M_PatientID": "879989",
|
||||
"M_PatientNoReg": "LAB0075641",
|
||||
"M_PatientPrefix": null,
|
||||
"M_PatientName": "DENNY HANDOYO",
|
||||
"M_PatientSuffix": null,
|
||||
"M_PatientHP": "082333349448",
|
||||
"M_PatientEmail": "",
|
||||
"M_PatientPOB": "SURABAYA",
|
||||
"M_PatientPhone": "",
|
||||
"M_PatientIDNumber": "3578170804790005",
|
||||
"M_PatientDOB": "08-04-1979",
|
||||
"M_PatientNote": "",
|
||||
"M_PatientNIK": null,
|
||||
"M_PatientJabatan": null,
|
||||
"M_PatientKedudukan": null,
|
||||
"M_PatientPJ": null,
|
||||
"M_PatientLocation": null,
|
||||
"M_PatientJob": null,
|
||||
"M_PatientM_SexID": "1",
|
||||
"M_SexName": "Laki - Laki ",
|
||||
"M_PatientM_TitleID": "2",
|
||||
"M_TitleName": "Tn",
|
||||
"M_PatientM_ReligionID": "0",
|
||||
"M_ReligionName": null,
|
||||
"M_PatientM_IdTypeID": "1",
|
||||
"M_IdTypeName": "KTP",
|
||||
"status": "active"
|
||||
},
|
||||
{
|
||||
"M_PatientID": "886903",
|
||||
"M_PatientNoReg": "LAB0082553",
|
||||
"M_PatientPrefix": null,
|
||||
"M_PatientName": "DENNY HANDOYO",
|
||||
"M_PatientSuffix": null,
|
||||
"M_PatientHP": "082333349448",
|
||||
"M_PatientEmail": "",
|
||||
"M_PatientPOB": "SURABAYA",
|
||||
"M_PatientPhone": "",
|
||||
"M_PatientIDNumber": "3578170804790005",
|
||||
"M_PatientDOB": "08-04-1979",
|
||||
"M_PatientNote": "",
|
||||
"M_PatientNIK": null,
|
||||
"M_PatientJabatan": null,
|
||||
"M_PatientKedudukan": null,
|
||||
"M_PatientPJ": null,
|
||||
"M_PatientLocation": null,
|
||||
"M_PatientJob": null,
|
||||
"M_PatientM_SexID": "1",
|
||||
"M_SexName": "Laki - Laki ",
|
||||
"M_PatientM_TitleID": "2",
|
||||
"M_TitleName": "Tn",
|
||||
"M_PatientM_ReligionID": "0",
|
||||
"M_ReligionName": null,
|
||||
"M_PatientM_IdTypeID": "1",
|
||||
"M_IdTypeName": "KTP",
|
||||
"status": "active"
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed : {
|
||||
dialog_national: {
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_national
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_dialog_national',val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<v-layout column>
|
||||
<v-dialog
|
||||
v-model="dialog_delivery_note"
|
||||
width="500"
|
||||
>
|
||||
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline blue lighten-2 white--text"
|
||||
>
|
||||
Catatan Pengiriman
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<v-layout row>
|
||||
<v-flex d-flex>
|
||||
<v-textarea
|
||||
outline
|
||||
label="Isikan Catatan"
|
||||
v-model="selected_delivery_for_note.note"
|
||||
></v-textarea>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex d-flex>
|
||||
<p class="red--text font-weight-bold caption">
|
||||
Untuk pengiriman email, penambahan catatan digunakan sebagai pengganti alamat email terpilih,
|
||||
jika lebih dari satu,
|
||||
tulis alamat email dengan separator koma
|
||||
contoh : aku@gmail.com, kamu@gmail.com, dia@gmail.com
|
||||
</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex d-flex>
|
||||
<p class="red--text font-weight-bold caption">
|
||||
Untuk pengiriman kurir, penambahan catatan digunakan sebagai keterangan
|
||||
dan tidak merubah kecamatan kelurahan,
|
||||
ketika proses spk kurir
|
||||
</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-card-text>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="primary"
|
||||
flat
|
||||
@click="addDeliveryNote()"
|
||||
>
|
||||
Tambahkan
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<h5 class="headline ml-2 mb-1">Pengiriman Hasil</h5>
|
||||
<v-container grid-list-md>
|
||||
<v-layout row wrap >
|
||||
<v-flex class="row" xs6 v-for="(delivery,idx) in deliveries"
|
||||
mt-2>
|
||||
<v-layout row wrap :class="{'ml-4':(idx%2)==1}" >
|
||||
<v-checkbox
|
||||
hide-details class="shrink mr-1"
|
||||
:value="delivery.idx"
|
||||
:disabled="delivery.typeform === 'note'"
|
||||
v-model="checked_id"
|
||||
></v-checkbox>
|
||||
|
||||
<v-text-field
|
||||
class="grow"
|
||||
:append-icon="delivery.typeform === 'md' ? 'add' : 'delete'"
|
||||
outline
|
||||
:value="delivery.note"
|
||||
:label="delivery.name"
|
||||
@input="(val) => updateDelivery(idx,val)"
|
||||
@click:append="doAction(idx,delivery)"
|
||||
hide-details
|
||||
readonly
|
||||
></v-text-field>
|
||||
</v-layout>
|
||||
</v-flex >
|
||||
|
||||
<!-- <v-flex class="row" xs6 v-for="(delivery,idx) in deliveries"
|
||||
:key="delivery.id" mt-2>
|
||||
<v-layout row wrap :class="{'ml-4':(idx%2)==1}" >
|
||||
<v-checkbox
|
||||
hide-details class="shrink mr-1"
|
||||
:value="delivery.selected"
|
||||
@change="(val) => updateSelected(idx,val)"
|
||||
></v-checkbox>
|
||||
|
||||
<v-text-field
|
||||
class="grow"
|
||||
outline
|
||||
:value="delivery.note"
|
||||
:label="delivery.name"
|
||||
@input="(val) => updateDelivery(idx,val)"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-layout>
|
||||
</v-flex > -->
|
||||
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-layout>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data () {
|
||||
return {
|
||||
dialog_delivery_note:false,
|
||||
selected_delivery_for_note:{}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
updateSelected(idx,val) {
|
||||
console.log('idx:'+idx)
|
||||
console.log('val:'+val)
|
||||
var deliveries = this.$store.state.delivery.deliveries
|
||||
deliveries[idx].selected = val
|
||||
this.$store.commit("delivery/update_deliveries",deliveries)
|
||||
},
|
||||
updateDelivery(idx,val) {
|
||||
var deliveries = this.$store.state.delivery.deliveries
|
||||
deliveries[idx].note = val
|
||||
this.$store.commit("delivery/update_deliveries",deliveries)
|
||||
},
|
||||
doAction(idx,val){
|
||||
if(val.typeform === 'md'){
|
||||
let dlv = this.$store.state.delivery.checked_id
|
||||
dlv.push(val.idx)
|
||||
this.$store.commit("delivery/update_checked_id",dlv)
|
||||
this.selected_delivery_for_note = _.clone(val, true)
|
||||
|
||||
if(val.code == 'EMAIL')
|
||||
this.selected_delivery_for_note.note = val.note
|
||||
else
|
||||
this.selected_delivery_for_note.note = ""
|
||||
|
||||
this.dialog_delivery_note = true
|
||||
}
|
||||
else{
|
||||
var deliveries = this.$store.state.delivery.deliveries
|
||||
deliveries.splice(idx, 1)
|
||||
this.$store.commit("delivery/update_deliveries",deliveries)
|
||||
}
|
||||
|
||||
},
|
||||
addDeliveryNote(){
|
||||
var xdt = this.selected_delivery_for_note
|
||||
let dlv = this.$store.state.delivery.checked_id
|
||||
|
||||
dlv.push(xdt.idx)
|
||||
this.$store.commit("delivery/update_checked_id",dlv)
|
||||
|
||||
xdt.typeform = 'note'
|
||||
xdt.id = Date.now()
|
||||
xdt.selected = xdt.idx
|
||||
var deliveries = this.$store.state.delivery.deliveries
|
||||
deliveries.push(xdt)
|
||||
this.$store.commit("delivery/update_deliveries",deliveries)
|
||||
this.dialog_delivery_note = false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
deliveries() {
|
||||
return this.$store.state.delivery.deliveries
|
||||
},
|
||||
|
||||
checked_id : {
|
||||
get() {
|
||||
return this.$store.state.delivery.checked_id
|
||||
},
|
||||
set(val) {
|
||||
console.log(val)
|
||||
this.$store.commit("delivery/update_checked_id", val)
|
||||
this.$store.commit("delivery/update_deliveries_2")
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
this.$store.dispatch('delivery/search')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user