Merge pull request 'Merge staging into master' (#4) from staging into master
Reviewed-on: #4
This commit was merged in pull request #4.
This commit is contained in:
@@ -62,10 +62,21 @@ master
|
|||||||
|
|
||||||
- Sebelum push atau menyiapkan merge, jalankan `git fetch origin`.
|
- Sebelum push atau menyiapkan merge, jalankan `git fetch origin`.
|
||||||
- Rebase ke base remote yang benar supaya conflict muncul lebih awal.
|
- 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.
|
- Jangan direct push ke protected branch.
|
||||||
- `master` dan `staging` dipakai sebagai branch tujuan PR.
|
- `master` dan `staging` dipakai sebagai branch tujuan PR.
|
||||||
- Untuk repo ini, upload ke `devcpone` dilakukan dari commit di `master` atau `staging`.
|
- 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
|
## Contoh Skenario 1
|
||||||
|
|
||||||
Kasus:
|
Kasus:
|
||||||
@@ -107,6 +118,20 @@ git rebase origin/master
|
|||||||
|
|
||||||
Kalau branch kerja memang berbasis `staging`, ganti target rebase ke `origin/staging`.
|
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
|
### 3. Commit dan push
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="tanggal">
|
<div class="tanggal">
|
||||||
{{f_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}}
|
{{branch_name}}
|
||||||
</span>
|
</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}} -->
|
Devone <!-- {{branch_name}} -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -32,9 +32,15 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
,computed: {
|
,computed: {
|
||||||
branch_name() {
|
branch_name() {
|
||||||
let branch = this.$store.state.system.branch
|
try {
|
||||||
if (branch.M_BranchName == undefined) return ''
|
let retrievedObject = localStorage.getItem("user")
|
||||||
return branch.M_BranchName
|
if (!retrievedObject) return ''
|
||||||
|
let dtuser = JSON.parse(retrievedObject)
|
||||||
|
if (dtuser.M_BranchName == undefined) return ''
|
||||||
|
return dtuser.M_BranchName
|
||||||
|
} catch(e) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
},
|
},
|
||||||
f_tanggal() {
|
f_tanggal() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
65
staging-to-master-diff-20260625-stemcell-fe.md
Normal file
65
staging-to-master-diff-20260625-stemcell-fe.md
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
# Staging to Master Diff - 2026-06-25
|
||||||
|
|
||||||
|
Perbandingan branch:
|
||||||
|
|
||||||
|
- `master...staging` = `4 6`
|
||||||
|
- Artinya ada `4` commit di `master` yang belum ada di `staging`
|
||||||
|
- Dan ada `6` commit di `staging` yang belum ada di `master`
|
||||||
|
|
||||||
|
## Commit yang ada di staging tapi belum ada di master
|
||||||
|
|
||||||
|
```text
|
||||||
|
fd25ae4 FHM17062601CPONE - clone resume individu cponev8
|
||||||
|
6d40e1c C1J0ET - add icd10 stemcell validation
|
||||||
|
46525e5 FHM24062601CPONE - update footer branch info
|
||||||
|
2716f15 FHM24062601CPONE - add branch name at footer
|
||||||
|
8caa27b 3Z4LPN - add git workflow guide
|
||||||
|
9d1c478 3Z4LPN - enable staging sync to devcpone
|
||||||
|
```
|
||||||
|
|
||||||
|
## Ringkasan file yang beda dari master ke staging
|
||||||
|
|
||||||
|
```text
|
||||||
|
GIT_WORKFLOW.md
|
||||||
|
apps/components/oneTanggal.vue
|
||||||
|
test/vuex/one-fo-registration-walk-in-stemcell/api/patient.js
|
||||||
|
test/vuex/one-fo-registration-walk-in-stemcell/components/patientDetail.vue
|
||||||
|
test/vuex/one-fo-registration-walk-in-stemcell/modules/order.js
|
||||||
|
test/vuex/one-fo-registration-walk-in-stemcell/modules/patient.js
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/api/price.js
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/api/resume.js
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/components/onePriceHeader.vue
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/components/onePriceList.vue
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/components/oneResumeLeft.vue
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/components/oneResumeRight.vue
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/index.php
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/modules/components/onePriceHeader.vue
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/modules/components/onePriceList.vue
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/modules/components/oneResumeLeft.vue
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/modules/components/oneResumeRight.vue
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/modules/price.js
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/modules/resume.js
|
||||||
|
test/vuex/one-mcu-resume-individu-cponev8/store.js
|
||||||
|
```
|
||||||
|
|
||||||
|
Stat diff:
|
||||||
|
|
||||||
|
```text
|
||||||
|
20 files changed, 9301 insertions(+), 27 deletions(-)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Commit yang ada di master tapi belum ada di staging
|
||||||
|
|
||||||
|
```text
|
||||||
|
4e2d687 Merge pull request '3Z4LPN - enable staging sync to devcpone' (#3) from staging_sync_devcpone into master
|
||||||
|
ed4af50 3Z4LPN - add git workflow guide
|
||||||
|
42fd070 3Z4LPN - enable staging sync to devcpone
|
||||||
|
79def3c Merge pull request '3Z4LPN - merge staging to master' (#2) from staging into master
|
||||||
|
```
|
||||||
|
|
||||||
|
## Catatan
|
||||||
|
|
||||||
|
- Secara isi kerjaan FE stemcell yang baru, perubahan utamanya ada di:
|
||||||
|
- modul `one-fo-registration-walk-in-stemcell`
|
||||||
|
- folder baru `one-mcu-resume-individu-cponev8`
|
||||||
|
- `master` saat ini punya history merge sendiri, jadi hitungan commit tidak simetris walaupun sebagian isi file saling tumpang tindih.
|
||||||
@@ -243,12 +243,12 @@ export async function edit(datas, id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function search_icd10(prm) {
|
export async function search_icd10(prm) {
|
||||||
try {
|
try {
|
||||||
var resp = await axios.post(URL + 'patient/search_icd10', prm);
|
var resp = await axios.post(URL + 'order/search_icd10', prm);
|
||||||
if (resp.status != 200) {
|
if (resp.status != 200) {
|
||||||
return {
|
return {
|
||||||
status: "ERR",
|
status: "ERR",
|
||||||
message: resp.statusText
|
message: resp.statusText
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -248,24 +248,24 @@
|
|||||||
></v-textarea>
|
></v-textarea>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
|
|
||||||
<!----<v-flex xs12 pa-1>
|
<v-flex xs12 pa-1>
|
||||||
<v-autocomplete
|
<v-autocomplete
|
||||||
label="ICD-10"
|
label="ICD-10"
|
||||||
v-model="selected_icd10"
|
v-model="selected_icd10"
|
||||||
:items="icd10"
|
:items="icd10"
|
||||||
:search-input.sync="search_icd10"
|
:search-input.sync="search_icd10"
|
||||||
class="pb-2"
|
class="pb-2"
|
||||||
no-filter
|
no-filter
|
||||||
:item-text="item => item.code + ' - ' + item.display"
|
:item-text="item => item.code + ' - ' + item.display"
|
||||||
item-value="code"
|
item-value="code"
|
||||||
return-object
|
return-object
|
||||||
:loading="loading_icd10"
|
:loading="loading_icd10"
|
||||||
no-data-text="Ketikkan pencarian ICD-10"
|
no-data-text="Ketikkan pencarian ICD-10"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
|
|
||||||
</v-autocomplete>
|
</v-autocomplete>
|
||||||
</v-flex>-->
|
</v-flex>
|
||||||
|
|
||||||
</v-flex>
|
</v-flex>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
@@ -425,4 +425,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -175,6 +175,18 @@ export default {
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
async save(context) {
|
async save(context) {
|
||||||
|
let diagnosa = context.state.diagnosa ? context.state.diagnosa.trim() : ''
|
||||||
|
let selectedIcd10 = context.rootState.patient.selected_icd10 || {}
|
||||||
|
let icd10Code = selectedIcd10.code ? selectedIcd10.code.toString().trim() : ''
|
||||||
|
|
||||||
|
if (!diagnosa && !icd10Code) {
|
||||||
|
context.commit('update_in_saving', false)
|
||||||
|
context.commit('update_loading_process', false)
|
||||||
|
context.commit('update_dialog_loading', false, { root: true })
|
||||||
|
context.commit('update_message_error', 'Diagnosa atau ICD-10 wajib diisi salah satu')
|
||||||
|
context.commit('update_dialog_pop_up_error', true)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var req = [];
|
var req = [];
|
||||||
var detail = [];
|
var detail = [];
|
||||||
@@ -224,9 +236,9 @@ export default {
|
|||||||
prm.selected_patient = context.rootState.patient.selected_patient
|
prm.selected_patient = context.rootState.patient.selected_patient
|
||||||
prm.patient_age = context.rootState.patient.selected_patient.patient_age
|
prm.patient_age = context.rootState.patient.selected_patient.patient_age
|
||||||
prm.patient_note = context.state.patient_note
|
prm.patient_note = context.state.patient_note
|
||||||
prm.diagnosa = context.state.diagnosa
|
prm.diagnosa = diagnosa
|
||||||
prm.catatan_fo = context.state.catatan_fo
|
prm.catatan_fo = context.state.catatan_fo
|
||||||
prm.selected_icd10 = context.rootState.patient.selected_icd10
|
prm.selected_icd10 = selectedIcd10
|
||||||
prm.selected_doctor = context.rootState.doctor.selected_doctor
|
prm.selected_doctor = context.rootState.doctor.selected_doctor
|
||||||
prm.selected_language = context.rootState.language.selected_language ? context.rootState.language.selected_language.id : 1
|
prm.selected_language = context.rootState.language.selected_language ? context.rootState.language.selected_language.id : 1
|
||||||
prm.selected_language_2 = context.rootState.language.selected_language_2 ? context.rootState.language.selected_language_2.id : 0
|
prm.selected_language_2 = context.rootState.language.selected_language_2 ? context.rootState.language.selected_language_2.id : 0
|
||||||
|
|||||||
@@ -472,9 +472,10 @@ export default {
|
|||||||
context.commit("update_loading_icd10",false)
|
context.commit("update_loading_icd10",false)
|
||||||
context.commit("update_search_error_message",resp.message)
|
context.commit("update_search_error_message",resp.message)
|
||||||
} else {
|
} else {
|
||||||
|
let records = Array.isArray(resp.data) ? resp.data : (resp.data && resp.data.records ? resp.data.records : [])
|
||||||
context.commit("update_loading_icd10",false)
|
context.commit("update_loading_icd10",false)
|
||||||
context.commit("update_search_error_message","")
|
context.commit("update_search_error_message","")
|
||||||
context.commit("update_icd10", resp.data.records)
|
context.commit("update_icd10", records)
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
context.commit("update_loading_icd10",false)
|
context.commit("update_loading_icd10",false)
|
||||||
|
|||||||
187
test/vuex/one-mcu-resume-individu-cponev8/api/price.js
Normal file
187
test/vuex/one-mcu-resume-individu-cponev8/api/price.js
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
const URL = "/one-api/mockup/mdprice/mdprice/";
|
||||||
|
|
||||||
|
// https://devcpone.aplikasi.web.id/one-api/mockup/mdprice/mdprice/searchpriceheader/
|
||||||
|
|
||||||
|
export async function search(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'searchpriceheader', 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 insertheader(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'insertpriceheader', 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 editheader(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'editpriceheader', 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 deleteheader(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'deletepriceheader', 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 getfilterprice(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'getfilterprice', 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 searchpricetest(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'searchpricetest', 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 savetest(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'savetest', 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 searchpricetestautocomplete(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'searchpriceheaderautocomplete', 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 copyharga(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'copyharga', 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 validateheader(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'validateheader', 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
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
148
test/vuex/one-mcu-resume-individu-cponev8/api/resume.js
Normal file
148
test/vuex/one-mcu-resume-individu-cponev8/api/resume.js
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
const URL = "/one-api/mockup/mcuoffline/Resumeindividucponev8/";
|
||||||
|
|
||||||
|
// https://devcpone.aplikasi.web.id/one-api/mockup/mdprice/mdprice/searchpriceheader/
|
||||||
|
|
||||||
|
export async function getsetup(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'getsetup', 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 + '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 getdetail(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'getdetail', 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 getdoctor(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'getdoctor', 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 getFitnessCategory(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'getFitnessCategory', 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 generateFitnessCategory(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'generateFitnessCategory', 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 save(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'save', 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 savedoctor(prm) {
|
||||||
|
try {
|
||||||
|
var resp = await axios.post(URL + 'savedoctor', 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
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,992 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<v-dialog persistent v-model="dialogValidasi" width="500">
|
||||||
|
<v-card>
|
||||||
|
<v-card-title class="headline grey lighten-2" primary-title>
|
||||||
|
<v-layout align-center justify-space-between row fill-height>
|
||||||
|
<div>KONFIRMASI</div>
|
||||||
|
</v-layout>
|
||||||
|
</v-card-title>
|
||||||
|
<v-card-text
|
||||||
|
>Apakah anda yakin akan mevalidasi
|
||||||
|
<kbd class="mx-2">{{ selectedPriceHeader.headerCode }}</kbd>
|
||||||
|
<span>{{ selectedPriceHeader.headerName }}</span> ?
|
||||||
|
</v-card-text>
|
||||||
|
<v-divider></v-divider>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn
|
||||||
|
color="error"
|
||||||
|
:disabled="loading"
|
||||||
|
flat
|
||||||
|
@click="dialogValidasi = false"
|
||||||
|
>
|
||||||
|
BATAL
|
||||||
|
</v-btn>
|
||||||
|
<v-btn
|
||||||
|
color="success"
|
||||||
|
:disabled="loading"
|
||||||
|
flat
|
||||||
|
@click="validateHeader()"
|
||||||
|
>
|
||||||
|
YAKIN
|
||||||
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
|
<v-layout class="fill-height" column>
|
||||||
|
<v-layout align-center column>
|
||||||
|
<v-toolbar dark color="primary">
|
||||||
|
<v-toolbar-title class="white--text">
|
||||||
|
<kbd class="mr-2">{{ this.selectedPriceHeader.headerCode }}</kbd>
|
||||||
|
{{ this.selectedPriceHeader.headerName }}</v-toolbar-title
|
||||||
|
>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<!-- v-if="selectedPriceHeader.headerValidate === 'N'" -->
|
||||||
|
<v-btn color="success" :disabled="loading" @click="handleSave()"
|
||||||
|
>Simpan</v-btn
|
||||||
|
>
|
||||||
|
<!-- selectedPriceHeader.headerValidate === 'N' && -->
|
||||||
|
<v-btn
|
||||||
|
:disabled="loading"
|
||||||
|
color="warning"
|
||||||
|
@click="dialogValidasi = true"
|
||||||
|
>Validasi
|
||||||
|
</v-btn>
|
||||||
|
<!-- <v-btn
|
||||||
|
:disabled="loading"
|
||||||
|
v-if="
|
||||||
|
selectedPriceHeader.headerValidate === 'Y' &&
|
||||||
|
selectedPriceHeader.validatePacket === 'Y' &&
|
||||||
|
selectedPriceHeader.readyValidate === 'Y'
|
||||||
|
"
|
||||||
|
color="warning"
|
||||||
|
@click="dialogValidasi = true"
|
||||||
|
>Validasi
|
||||||
|
</v-btn> -->
|
||||||
|
</v-toolbar>
|
||||||
|
<v-card style="width: 100%" class="mb-2 pa-2 searchbox">
|
||||||
|
<v-layout row>
|
||||||
|
<v-flex xs4 class="mr-1">
|
||||||
|
<v-text-field
|
||||||
|
label="Kode/nama"
|
||||||
|
hide-details
|
||||||
|
:loading="loading"
|
||||||
|
v-model="filterName"
|
||||||
|
outline
|
||||||
|
></v-text-field>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs4 class="mr-1 ml-1">
|
||||||
|
<v-autocomplete
|
||||||
|
label="Sub Group"
|
||||||
|
v-model="selectedFilterSubGroup"
|
||||||
|
:items="filterSubGroup"
|
||||||
|
item-text="name"
|
||||||
|
outline
|
||||||
|
hide-details
|
||||||
|
:disabled="loading"
|
||||||
|
return-object
|
||||||
|
:loading="loading"
|
||||||
|
no-data-text="Pilih Sub Group"
|
||||||
|
>
|
||||||
|
<template slot="item" slot-scope="{ item }">
|
||||||
|
<v-list-tile-content>
|
||||||
|
<v-list-tile-title v-text="item.name"></v-list-tile-title>
|
||||||
|
</v-list-tile-content>
|
||||||
|
</template>
|
||||||
|
</v-autocomplete>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs4 class="ml-1">
|
||||||
|
<v-autocomplete
|
||||||
|
label="Status"
|
||||||
|
v-model="selectedFilterStatus"
|
||||||
|
:items="filterStatus"
|
||||||
|
item-text="name"
|
||||||
|
outline
|
||||||
|
hide-details
|
||||||
|
return-object
|
||||||
|
:disabled="loading"
|
||||||
|
:loading="loading"
|
||||||
|
no-data-text="Pilih Status"
|
||||||
|
>
|
||||||
|
<template slot="item" slot-scope="{ item }">
|
||||||
|
<v-list-tile-content>
|
||||||
|
<v-list-tile-title v-text="item.name"></v-list-tile-title>
|
||||||
|
</v-list-tile-content>
|
||||||
|
</template>
|
||||||
|
</v-autocomplete>
|
||||||
|
</v-flex>
|
||||||
|
</v-layout>
|
||||||
|
</v-card>
|
||||||
|
</v-layout>
|
||||||
|
<v-card style="overflow-y: scroll; height: 65vh" class="fill-height">
|
||||||
|
<v-data-table
|
||||||
|
:loading="loading"
|
||||||
|
:items="priceTestList"
|
||||||
|
:headers="headers"
|
||||||
|
class="v-table elevation-1"
|
||||||
|
hide-actions
|
||||||
|
>
|
||||||
|
<template v-slot:headers="props">
|
||||||
|
<tr>
|
||||||
|
<th
|
||||||
|
v-for="header in props.headers"
|
||||||
|
:width="header.width"
|
||||||
|
:class="header.class"
|
||||||
|
>
|
||||||
|
{{ header.text }}
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
<v-progress-linear
|
||||||
|
v-slot:progress="loading"
|
||||||
|
color="blue"
|
||||||
|
:indeterminate="true"
|
||||||
|
></v-progress-linear>
|
||||||
|
<template v-slot:items="props">
|
||||||
|
<tr>
|
||||||
|
<td class="py-2">
|
||||||
|
<div style="color: brown" class="mb-0">
|
||||||
|
<v-btn
|
||||||
|
small
|
||||||
|
color="success"
|
||||||
|
class="white--text"
|
||||||
|
v-if="props.item.status === 'Y'"
|
||||||
|
>
|
||||||
|
<v-icon left dark>check</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
<v-btn
|
||||||
|
small
|
||||||
|
color="error"
|
||||||
|
class="white--text"
|
||||||
|
v-if="props.item.status === 'N'"
|
||||||
|
>
|
||||||
|
<v-icon right dark>close</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="py-2">
|
||||||
|
<!-- v-bind:class="{ 'amber lighten-4': isSelected(props.item) }" -->
|
||||||
|
<p style="" class="mb-1">
|
||||||
|
<kbd class="mr-2">{{ props.item.testCode }}</kbd>
|
||||||
|
<span class="font-weight-bold">
|
||||||
|
{{ props.item.testName }}
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td class="py-2">
|
||||||
|
<!-- v-bind:class="{ 'amber lighten-4': isSelected(props.item) }" -->
|
||||||
|
<v-text-field
|
||||||
|
label="Amount"
|
||||||
|
type="number"
|
||||||
|
v-model="props.item.priceAmount"
|
||||||
|
hide-details
|
||||||
|
:disabled="
|
||||||
|
(selectedPriceHeader.headerValidate === 'Y' &&
|
||||||
|
props.item.status === 'Y') ||
|
||||||
|
loading
|
||||||
|
"
|
||||||
|
@input="handleChangeAmount(props.item)"
|
||||||
|
outline
|
||||||
|
></v-text-field>
|
||||||
|
<!-- v-on:change="handleChangeAmount(props.item.priceAmount)" -->
|
||||||
|
<!-- :rules="[rules.min]" -->
|
||||||
|
</td>
|
||||||
|
<td class="py-2">
|
||||||
|
<v-text-field
|
||||||
|
label="Diskon %"
|
||||||
|
type="number"
|
||||||
|
v-model="props.item.priceDisc"
|
||||||
|
@input="handleChangeDisc(props.item)"
|
||||||
|
:disabled="
|
||||||
|
props.item.priceAmount === NaN ||
|
||||||
|
props.item.priceAmount === null ||
|
||||||
|
props.item.priceAmount === undefined ||
|
||||||
|
props.item.priceAmount <= 0 ||
|
||||||
|
props.item.priceAmount === '' ||
|
||||||
|
(selectedPriceHeader.headerValidate === 'Y' &&
|
||||||
|
props.item.status === 'Y') ||
|
||||||
|
loading
|
||||||
|
"
|
||||||
|
hide-details
|
||||||
|
outline
|
||||||
|
></v-text-field>
|
||||||
|
<!-- :rules="[rules.min, rules.maxPersen]" -->
|
||||||
|
</td>
|
||||||
|
<td class="py-2">
|
||||||
|
<!-- v-bind:class="{ 'amber lighten-4': isSelected(props.item) }" -->
|
||||||
|
<v-text-field
|
||||||
|
label="Diskon Rp"
|
||||||
|
type="number"
|
||||||
|
v-model="props.item.priceDiscRp"
|
||||||
|
@input="handleChangeDiscRp(props.item)"
|
||||||
|
:disabled="
|
||||||
|
props.item.priceAmount === NaN ||
|
||||||
|
props.item.priceAmount === null ||
|
||||||
|
props.item.priceAmount === undefined ||
|
||||||
|
props.item.priceAmount <= 0 ||
|
||||||
|
props.item.priceAmount === '' ||
|
||||||
|
(selectedPriceHeader.headerValidate === 'Y' &&
|
||||||
|
props.item.status === 'Y') ||
|
||||||
|
loading
|
||||||
|
"
|
||||||
|
hide-details
|
||||||
|
outline
|
||||||
|
></v-text-field>
|
||||||
|
<!-- :rules="[rules.min]" -->
|
||||||
|
</td>
|
||||||
|
<td class="py-2">
|
||||||
|
<!-- v-bind:class="{ 'amber lighten-4': isSelected(props.item) }" -->
|
||||||
|
<v-text-field
|
||||||
|
label="Total"
|
||||||
|
type="number"
|
||||||
|
readonly
|
||||||
|
v-model="props.item.subTotal"
|
||||||
|
hide-details
|
||||||
|
outline
|
||||||
|
></v-text-field>
|
||||||
|
<!-- :rules="[rules.min]" -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
</v-data-table>
|
||||||
|
</v-card>
|
||||||
|
<v-card class="pa-2">
|
||||||
|
<div class="text-xs-left">
|
||||||
|
<v-pagination
|
||||||
|
v-model="priceTestPage"
|
||||||
|
:length="priceTestPageTotal"
|
||||||
|
></v-pagination>
|
||||||
|
</div>
|
||||||
|
</v-card>
|
||||||
|
</v-layout>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
.searchbox .v-input.v-text-field .v-input__slot {
|
||||||
|
min-height: 60px;
|
||||||
|
}
|
||||||
|
.searchbox .v-btn {
|
||||||
|
min-height: 60px;
|
||||||
|
}
|
||||||
|
table.v-table tbody td,
|
||||||
|
table.v-table tbody th {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.v-table thead tr {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
.scroll-container {
|
||||||
|
scroll-padding: 50px 0 0 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this targets the default scrollbar (compulsory) */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background-color: #73baf3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the new scrollbar will have a flat appearance with the set background color */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #2196f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this will style the thumb, ignoring the track */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-button {
|
||||||
|
background-color: #0079da;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-corner {
|
||||||
|
background-color: black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
// const { data } = require("./onePriceHeader.vue");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
// components: {
|
||||||
|
// "one-dialog-info": httpVueLoader("../../common/oneDialogInfo.vue"),
|
||||||
|
// "one-dialog-alert": httpVueLoader("../../common/oneDialogAlert.vue"),
|
||||||
|
// },
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
closeDialogQrCode() {
|
||||||
|
this.dialogQrCode = false;
|
||||||
|
},
|
||||||
|
handleChangeAmount(data) {
|
||||||
|
console.log(data);
|
||||||
|
// priceAmount
|
||||||
|
// priceDisc
|
||||||
|
// priceDiscRp
|
||||||
|
// subTotal
|
||||||
|
// testID
|
||||||
|
if (data.priceAmount.trim() === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
data.isChange = "Y";
|
||||||
|
cek = parseFloat(data.priceAmount);
|
||||||
|
if (isNaN(cek)) {
|
||||||
|
data.subTotal = 0;
|
||||||
|
alert("Inputan tes " + data.testName + "harus berupa angka");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (parseFloat(data.priceAmount) < 0) {
|
||||||
|
alert(" price amount test " + data.testName + "Kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
amount = parseFloat(data.priceAmount);
|
||||||
|
diskon = 0;
|
||||||
|
if (
|
||||||
|
data.priceDisc !== "" &&
|
||||||
|
data.priceDisc !== null &&
|
||||||
|
data.priceDisc !== "0" &&
|
||||||
|
data.priceDisc !== 0
|
||||||
|
) {
|
||||||
|
diskon = parseFloat(data.priceDisc);
|
||||||
|
}
|
||||||
|
|
||||||
|
diskonRp = 0;
|
||||||
|
if (
|
||||||
|
data.priceDiscRp !== "" &&
|
||||||
|
data.priceDiscRp !== null &&
|
||||||
|
data.priceDiscRp !== "0" &&
|
||||||
|
data.priceDiscRp !== 0
|
||||||
|
) {
|
||||||
|
diskonRp = parseFloat(data.priceDiscRp);
|
||||||
|
}
|
||||||
|
total = 0;
|
||||||
|
if (data.subTotal !== "" && data.subTotal !== null) {
|
||||||
|
total = parseFloat(data.subTotal);
|
||||||
|
}
|
||||||
|
let newTotal = 0;
|
||||||
|
|
||||||
|
diskonAmount = (diskon / 100) * amount;
|
||||||
|
newTotal = amount - diskonAmount - diskonRp;
|
||||||
|
|
||||||
|
console.log("new total");
|
||||||
|
console.log(newTotal);
|
||||||
|
if (newTotal < 0) {
|
||||||
|
alert("Total tes " + data.testName + " tidak boleh kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (newTotal == NaN) {
|
||||||
|
newTotal = 0;
|
||||||
|
}
|
||||||
|
data.subTotal = newTotal;
|
||||||
|
},
|
||||||
|
handleChangeDisc(data) {
|
||||||
|
data.isChange = "Y";
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
|
// data.priceDiscRp = 0;
|
||||||
|
// priceAmount
|
||||||
|
// priceDisc
|
||||||
|
// priceDiscRp
|
||||||
|
// subTotal
|
||||||
|
// testID
|
||||||
|
if (data.priceDisc.trim() === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cek = parseFloat(data.priceDisc);
|
||||||
|
if (isNaN(cek)) {
|
||||||
|
alert("Inputan tes " + data.testName + "harus berupa angka");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (parseFloat(data.priceAmount) < 0) {
|
||||||
|
alert(" price amount test " + data.testName + "Kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
amount = parseFloat(data.priceAmount);
|
||||||
|
diskon = 0;
|
||||||
|
if (
|
||||||
|
data.priceDisc !== "" &&
|
||||||
|
data.priceDisc !== null &&
|
||||||
|
data.priceDisc !== "0" &&
|
||||||
|
data.priceDisc !== 0
|
||||||
|
) {
|
||||||
|
diskon = parseFloat(data.priceDisc);
|
||||||
|
}
|
||||||
|
if (diskon < 0 || diskon > 100) {
|
||||||
|
alert(
|
||||||
|
"Diskon tes " +
|
||||||
|
data.testName +
|
||||||
|
" tidak boleh kurang dari 0 dan tidak boleh lebih dari 100"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
diskonRp = 0;
|
||||||
|
if (
|
||||||
|
data.priceDiscRp !== "" &&
|
||||||
|
data.priceDiscRp !== null &&
|
||||||
|
data.priceDiscRp !== "0" &&
|
||||||
|
data.priceDiscRp !== 0
|
||||||
|
) {
|
||||||
|
diskonRp = parseFloat(data.priceDiscRp);
|
||||||
|
}
|
||||||
|
total = 0;
|
||||||
|
if (data.subTotal !== "" && data.subTotal !== null) {
|
||||||
|
total = parseFloat(data.subTotal);
|
||||||
|
}
|
||||||
|
let newTotal = 0;
|
||||||
|
|
||||||
|
diskonAmount = (diskon / 100) * amount;
|
||||||
|
newTotal = amount - diskonAmount - diskonRp;
|
||||||
|
|
||||||
|
if (newTotal < 0) {
|
||||||
|
alert("Total tes " + data.testName + " tidak boleh kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log("new total");
|
||||||
|
console.log(newTotal);
|
||||||
|
if (newTotal < 0) {
|
||||||
|
alert(
|
||||||
|
"Total tes " +
|
||||||
|
data.testName +
|
||||||
|
" tidak boleh kurang dari price amount"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (newTotal == NaN) {
|
||||||
|
newTotal = 0;
|
||||||
|
}
|
||||||
|
data.subTotal = newTotal;
|
||||||
|
},
|
||||||
|
handleChangeDiscRp(data) {
|
||||||
|
data.isChange = "Y";
|
||||||
|
if (data.priceDisc.trim() === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
|
// priceAmount
|
||||||
|
// priceDisc
|
||||||
|
// priceDiscRp
|
||||||
|
// subTotal
|
||||||
|
// testID
|
||||||
|
if (data.priceDiscRp.trim() === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cek = parseFloat(data.priceDiscRp);
|
||||||
|
if (isNaN(cek) && data.priceDiscRp !== "") {
|
||||||
|
alert("Inputan tes " + data.testName + "harus berupa angka");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (parseFloat(data.priceDiscRp) < 0) {
|
||||||
|
alert(" price amount test " + data.testName + "Kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
amount = parseFloat(data.priceAmount);
|
||||||
|
diskon = 0;
|
||||||
|
if (
|
||||||
|
data.priceDisc !== "" &&
|
||||||
|
data.priceDisc !== null &&
|
||||||
|
data.priceDisc !== "0" &&
|
||||||
|
data.priceDisc !== 0
|
||||||
|
) {
|
||||||
|
diskon = parseFloat(data.priceDisc);
|
||||||
|
}
|
||||||
|
|
||||||
|
diskonRp = 0;
|
||||||
|
if (
|
||||||
|
data.priceDiscRp !== "" &&
|
||||||
|
data.priceDiscRp !== null &&
|
||||||
|
data.priceDiscRp !== "0" &&
|
||||||
|
data.priceDiscRp !== 0
|
||||||
|
) {
|
||||||
|
diskonRp = parseFloat(data.priceDiscRp);
|
||||||
|
}
|
||||||
|
if (diskonRp < 0 || diskonRp > amount) {
|
||||||
|
alert(
|
||||||
|
"Diskon tes " +
|
||||||
|
data.testName +
|
||||||
|
" tidak boleh kurang dari 0 dan tidak boleh lebih dari price amount"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
total = 0;
|
||||||
|
if (data.subTotal !== "" && data.subTotal !== null) {
|
||||||
|
total = parseFloat(data.subTotal);
|
||||||
|
}
|
||||||
|
let newTotal = 0;
|
||||||
|
diskonAmount = (diskon / 100) * amount;
|
||||||
|
newTotal = amount - diskonAmount - diskonRp;
|
||||||
|
|
||||||
|
console.log("new total");
|
||||||
|
console.log(newTotal);
|
||||||
|
if (newTotal < 0) {
|
||||||
|
alert("Total tes " + data.testName + " tidak boleh kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (newTotal == NaN) {
|
||||||
|
newTotal = 0;
|
||||||
|
}
|
||||||
|
data.subTotal = newTotal;
|
||||||
|
},
|
||||||
|
handleSave() {
|
||||||
|
let submitted = [];
|
||||||
|
data = this.priceTestList;
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
const e = data[i];
|
||||||
|
if (
|
||||||
|
e.priceAmount !== "" &&
|
||||||
|
e.priceAmount !== null &&
|
||||||
|
e.priceAmount !== undefined
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
isNaN(e.priceAmount) ||
|
||||||
|
isNaN(e.priceDisc) ||
|
||||||
|
isNaN(e.priceDiscRp)
|
||||||
|
) {
|
||||||
|
alert("Input test " + e.testName + " salah, mohon ulangi");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
diskon = parseFloat(e.priceDisc);
|
||||||
|
diskonRp = parseFloat(e.priceDiscRp);
|
||||||
|
amount = parseFloat(e.priceAmount);
|
||||||
|
total = parseFloat(e.subTotal);
|
||||||
|
if (diskon > 100) {
|
||||||
|
alert(
|
||||||
|
"Diskon % test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari 100, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskon < 0) {
|
||||||
|
alert(
|
||||||
|
"Diskon % test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskonRp > amount) {
|
||||||
|
alert(
|
||||||
|
"Diskon Rp test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari price amount, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskonRp < 0) {
|
||||||
|
alert(
|
||||||
|
"Diskon Rp test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (total < 0) {
|
||||||
|
alert(
|
||||||
|
"Total test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (total > amount) {
|
||||||
|
console.log(total);
|
||||||
|
console.log(amount);
|
||||||
|
alert(
|
||||||
|
"Total test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari price amount, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.isChange == "Y") {
|
||||||
|
submitted.push(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(submitted);
|
||||||
|
if (submitted.length > 0) {
|
||||||
|
console.log("submitted > 0");
|
||||||
|
this.$store.dispatch("price/savetest", {
|
||||||
|
test: submitted,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("Tidak ada yang perlu disimpan");
|
||||||
|
}
|
||||||
|
// priceAmount
|
||||||
|
// priceDisc
|
||||||
|
// priceDiscRp
|
||||||
|
// subTotal
|
||||||
|
// testID
|
||||||
|
},
|
||||||
|
handleChangeFIlter() {
|
||||||
|
let submitted = [];
|
||||||
|
data = this.priceTestList;
|
||||||
|
if (data !== undefined && data !== null) {
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
const e = data[i];
|
||||||
|
if (
|
||||||
|
e.priceAmount !== "" &&
|
||||||
|
e.priceAmount !== null &&
|
||||||
|
e.priceAmount !== undefined
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
isNaN(e.priceAmount) ||
|
||||||
|
isNaN(e.priceDisc) ||
|
||||||
|
isNaN(e.priceDiscRp)
|
||||||
|
) {
|
||||||
|
alert("Input test " + e.testName + " salah, mohon ulangi");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
diskon = parseFloat(e.priceDisc);
|
||||||
|
diskonRp = parseFloat(e.priceDiscRp);
|
||||||
|
amount = parseFloat(e.priceAmount);
|
||||||
|
total = parseFloat(e.subTotal);
|
||||||
|
if (diskon > 100) {
|
||||||
|
alert(
|
||||||
|
"Diskon % test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari 100, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskon < 0) {
|
||||||
|
alert(
|
||||||
|
"Diskon % test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskonRp > amount) {
|
||||||
|
alert(
|
||||||
|
"Diskon Rp test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari price amount, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskonRp < 0) {
|
||||||
|
alert(
|
||||||
|
"Diskon Rp test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (total < 0) {
|
||||||
|
alert(
|
||||||
|
"Total test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (total > amount) {
|
||||||
|
console.log(total);
|
||||||
|
console.log(amount);
|
||||||
|
alert(
|
||||||
|
"Total test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari price amount, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.isChange == "Y") {
|
||||||
|
submitted.push(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(submitted);
|
||||||
|
// priceAmount
|
||||||
|
// priceDisc
|
||||||
|
// priceDiscRp
|
||||||
|
// subTotal
|
||||||
|
// testID
|
||||||
|
return submitted;
|
||||||
|
},
|
||||||
|
validateHeader() {
|
||||||
|
this.$store.dispatch("price/validateheader");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
filterName: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.filterName;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
let dt = this.handleChangeFIlter();
|
||||||
|
if (dt !== undefined && dt !== null) {
|
||||||
|
if (dt.length > 0) {
|
||||||
|
if (
|
||||||
|
confirm(
|
||||||
|
"Data belum belum tersimpan, Apakah anda yakin untuk melanjutkan ?"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
this.$store.commit("price/update_filterName", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$store.commit("price/update_filterName", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filterSubGroup: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.filterSubGroup;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_filterSubGroup", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filterStatus: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.filterStatus;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_filterStatus", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selectedFilterSubGroup: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.selectedFilterSubGroup;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
let dt = this.handleChangeFIlter();
|
||||||
|
if (dt !== undefined && dt !== null) {
|
||||||
|
if (dt.length > 0) {
|
||||||
|
if (
|
||||||
|
confirm(
|
||||||
|
"Data belum belum tersimpan, Apakah anda yakin untuk melanjutkan ?"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
this.$store.commit("price/update_selectedFilterSubGroup", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$store.commit("price/update_selectedFilterSubGroup", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selectedFilterStatus: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.selectedFilterStatus;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
let dt = this.handleChangeFIlter();
|
||||||
|
if (dt !== undefined && dt !== null) {
|
||||||
|
if (dt.length > 0) {
|
||||||
|
if (
|
||||||
|
confirm(
|
||||||
|
"Data belum belum tersimpan, Apakah anda yakin untuk melanjutkan ?"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
this.$store.commit("price/update_selectedFilterStatus", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$store.commit("price/update_selectedFilterStatus", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.loading;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_loading", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
errorMsg: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.errorMsg;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_errorMsg", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
snackbarError: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.snackbarError;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_snackbarError", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
snackbarSuccess: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.snackbarSuccess;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_snackbarSuccess", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selectedPriceHeader: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.selectedPriceHeader;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_selectedPriceHeader", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
successMsg: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.successMsg;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_successMsg", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
priceTestList: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.priceTestList;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_priceTestList", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
priceTestPageTotal: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.priceTestPageTotal;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_priceTestPageTotal", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dialogValidasi: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.dialogValidasi;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_dialogValidasi", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
priceTestPage: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.priceTestPage;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
dt = this.handleChangeFIlter();
|
||||||
|
if (dt.length > 0) {
|
||||||
|
if (
|
||||||
|
confirm(
|
||||||
|
"Data belum belum tersimpan, Apakah anda yakin untuk melanjutkan ?"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
this.$store.commit("price/update_priceTestPage", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$store.commit("price/update_priceTestPage", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selected_delivery: {},
|
||||||
|
search_company: "",
|
||||||
|
search_test: "",
|
||||||
|
menufilterdatestart: false,
|
||||||
|
menufilterdateend: false,
|
||||||
|
date: new Date().toISOString().substr(0, 10),
|
||||||
|
items: [],
|
||||||
|
menustartdate: false,
|
||||||
|
menuenddate: false,
|
||||||
|
errors: [],
|
||||||
|
sheet: false,
|
||||||
|
indeterminatex: false,
|
||||||
|
checkednotall: false,
|
||||||
|
bar_chx_all: false,
|
||||||
|
selected_barcode: [],
|
||||||
|
dialogtimeline: false,
|
||||||
|
search_doctor: "",
|
||||||
|
dialogWarning: false,
|
||||||
|
dialogWarningMsg: "",
|
||||||
|
rules: {
|
||||||
|
min: (v) => v > 0 || "Minimum value 1",
|
||||||
|
maxPersen: (v) => v <= 100 || "Maximum value 100",
|
||||||
|
},
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
text: "STATUS",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "10%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "TEST",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "25%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "AMOUNT",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "15%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "DISKON",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "name",
|
||||||
|
width: "15%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "DISKON RP",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "name",
|
||||||
|
width: "15%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "TOTAL",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "status",
|
||||||
|
width: "20%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,646 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- :title="printtitle" :width="printwidth" :height="500" :status="openprint"
|
||||||
|
:urlprint="urlprint" @close-dialog-print="closePrint" -->
|
||||||
|
<v-dialog v-model="openprint" width="80%">
|
||||||
|
<v-card>
|
||||||
|
<v-card-title class="headline grey lighten-2" primary-title>
|
||||||
|
Cetak Label
|
||||||
|
</v-card-title>
|
||||||
|
|
||||||
|
<v-card-text>
|
||||||
|
<v-layout wrap align-center>
|
||||||
|
<v-flex xs12>
|
||||||
|
<v-select
|
||||||
|
:items="LabelTypeList"
|
||||||
|
v-model="selectedLabelType"
|
||||||
|
></v-select>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs12>
|
||||||
|
<object :data="urlprint" width="100%" height="500"></object>
|
||||||
|
</v-flex>
|
||||||
|
</v-layout>
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
|
<v-divider></v-divider>
|
||||||
|
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn color="primary" flat @click="closePrint"> Tutup </v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
|
<v-snackbar
|
||||||
|
color="success"
|
||||||
|
v-model="snackbarSuccess"
|
||||||
|
right="right"
|
||||||
|
:timeout="3000"
|
||||||
|
top="top"
|
||||||
|
>
|
||||||
|
{{ successMsg }}
|
||||||
|
<v-btn color="white" flat @click="snackbarSuccess = false"> Close </v-btn>
|
||||||
|
</v-snackbar>
|
||||||
|
<v-snackbar
|
||||||
|
color="warning"
|
||||||
|
v-model="snackbarWarning"
|
||||||
|
right="right"
|
||||||
|
:timeout="3000"
|
||||||
|
top="top"
|
||||||
|
>
|
||||||
|
{{ warningMsg }}
|
||||||
|
<v-btn color="white" flat @click="snackbarWarning = false"> Close </v-btn>
|
||||||
|
</v-snackbar>
|
||||||
|
<v-snackbar
|
||||||
|
color="error"
|
||||||
|
v-model="snackbarError"
|
||||||
|
right="right"
|
||||||
|
:timeout="3000"
|
||||||
|
top="top"
|
||||||
|
>
|
||||||
|
{{ errorMsg }}
|
||||||
|
<v-btn color="white" flat @click="snackbarError = false"> Close </v-btn>
|
||||||
|
</v-snackbar>
|
||||||
|
<v-layout class="fill-height" column>
|
||||||
|
<v-card style="width: 100%;" class="mb-2 pa-2">
|
||||||
|
<v-layout row wrap>
|
||||||
|
<v-flex xs12 class="mb-2">
|
||||||
|
<v-autocomplete
|
||||||
|
label="Pilih Proyek MCU"
|
||||||
|
v-model="selectedSetup"
|
||||||
|
:items="setupList"
|
||||||
|
item-text="Mgm_McuLabel"
|
||||||
|
outline
|
||||||
|
hide-details
|
||||||
|
return-object
|
||||||
|
no-data-text="Pilih Proyek MCU"
|
||||||
|
>
|
||||||
|
<template slot="item" slot-scope="{ item }">
|
||||||
|
<v-list-tile-content>
|
||||||
|
<v-list-tile-title
|
||||||
|
v-text="item.Mgm_McuLabel"
|
||||||
|
></v-list-tile-title>
|
||||||
|
</v-list-tile-content>
|
||||||
|
</template>
|
||||||
|
</v-autocomplete>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs6 class="mb-2">
|
||||||
|
<v-menu
|
||||||
|
v-model="menuFormDateStart"
|
||||||
|
:close-on-content-click="false"
|
||||||
|
:nudge-right="40"
|
||||||
|
lazy
|
||||||
|
transition="scale-transition"
|
||||||
|
offset-y
|
||||||
|
full-width
|
||||||
|
max-width="290px"
|
||||||
|
min-width="290px"
|
||||||
|
>
|
||||||
|
<template v-slot:activator="{ on }">
|
||||||
|
<v-text-field
|
||||||
|
class="mr-2"
|
||||||
|
v-model="formatedStartDate"
|
||||||
|
label="Tanggal Awal"
|
||||||
|
outline
|
||||||
|
hide-details
|
||||||
|
readonly
|
||||||
|
v-on="on"
|
||||||
|
@blur="deFormatedDate(formatedStartDate)"
|
||||||
|
></v-text-field>
|
||||||
|
</template>
|
||||||
|
<v-date-picker
|
||||||
|
v-model="startDate"
|
||||||
|
no-title
|
||||||
|
@input="menuFormDateStart = false"
|
||||||
|
></v-date-picker>
|
||||||
|
</v-menu>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs6 class="mb-2">
|
||||||
|
<v-menu
|
||||||
|
v-model="menuFormDateEnd"
|
||||||
|
:close-on-content-click="false"
|
||||||
|
:nudge-right="40"
|
||||||
|
lazy
|
||||||
|
transition="scale-transition"
|
||||||
|
offset-y
|
||||||
|
full-width
|
||||||
|
max-width="290px"
|
||||||
|
min-width="290px"
|
||||||
|
>
|
||||||
|
<template v-slot:activator="{ on }">
|
||||||
|
<v-text-field
|
||||||
|
class="ml-2"
|
||||||
|
v-model="formatedEndDate"
|
||||||
|
label="Tanggal Akhir"
|
||||||
|
outline
|
||||||
|
readonly
|
||||||
|
hide-details
|
||||||
|
v-on="on"
|
||||||
|
@blur="deFormatedDate(formatedEndDate)"
|
||||||
|
></v-text-field>
|
||||||
|
</template>
|
||||||
|
<v-date-picker
|
||||||
|
v-model="endDate"
|
||||||
|
no-title
|
||||||
|
@input="menuFormDateEnd = false"
|
||||||
|
></v-date-picker>
|
||||||
|
</v-menu>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs12>
|
||||||
|
<v-text-field
|
||||||
|
label="Cari..."
|
||||||
|
outline
|
||||||
|
hide-details
|
||||||
|
v-model="search"
|
||||||
|
></v-text-field>
|
||||||
|
</v-flex>
|
||||||
|
</v-layout>
|
||||||
|
</v-card>
|
||||||
|
</v-layout>
|
||||||
|
<v-layout
|
||||||
|
row
|
||||||
|
wrap
|
||||||
|
v-if="
|
||||||
|
selectedSetup.Mgm_McuID !== null &&
|
||||||
|
selectedSetup.Mgm_McuID !== undefined
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<v-card class="py-2 px-2" style="width: 100%;">
|
||||||
|
<div>
|
||||||
|
<v-btn depressed small @click="print()" color="warning"
|
||||||
|
>Cetak Label</v-btn
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<!-- <span
|
||||||
|
|
||||||
|
class="icon-medium-fill-base-small xs1 white--text blue-grey icon-print"
|
||||||
|
></span> -->
|
||||||
|
</v-card>
|
||||||
|
</v-layout>
|
||||||
|
<v-card style="overflow-y: scroll; height: 55vh;" class="fill-height">
|
||||||
|
<v-data-table
|
||||||
|
:loading="loading"
|
||||||
|
:items="patientList"
|
||||||
|
:headers="headers"
|
||||||
|
class="v-table elevation-1"
|
||||||
|
hide-actions
|
||||||
|
>
|
||||||
|
<template v-slot:headers="props">
|
||||||
|
<tr>
|
||||||
|
<th
|
||||||
|
v-for="header in props.headers"
|
||||||
|
:width="header.width"
|
||||||
|
:class="header.class"
|
||||||
|
>
|
||||||
|
{{ header.text }}
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
<v-progress-linear
|
||||||
|
v-slot:progress="loading"
|
||||||
|
color="blue"
|
||||||
|
:indeterminate="true"
|
||||||
|
></v-progress-linear>
|
||||||
|
<template v-slot:items="props">
|
||||||
|
<tr @click="selectMe(props.item)">
|
||||||
|
<!-- 'deep-orange darken-1': props.item.status !== 'NEW', -->
|
||||||
|
<td
|
||||||
|
v-bind:class="{
|
||||||
|
'yellow lighten-4': isSelected(props.item),
|
||||||
|
'py-2 align-center text-sm-left': true,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<!-- <v-layout
|
||||||
|
align-start
|
||||||
|
justify-start
|
||||||
|
row
|
||||||
|
fill-height
|
||||||
|
class="text-sm-left"
|
||||||
|
>
|
||||||
|
<v-flex v-if="props.item.status !== 'NEW'" xs3
|
||||||
|
><v-icon color="success" right>check_circle</v-icon>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs9>
|
||||||
|
</v-flex>
|
||||||
|
</v-layout> -->
|
||||||
|
<p
|
||||||
|
v-bind:class="{
|
||||||
|
'green--text': props.item.status !== 'NEW',
|
||||||
|
}"
|
||||||
|
class="font-weight-bold body-2"
|
||||||
|
>
|
||||||
|
{{ props.item.labNumber }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
v-bind:class="{
|
||||||
|
'yellow lighten-4': isSelected(props.item),
|
||||||
|
'py-2': true,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<p class="body-2">{{ props.item.orderDate }}</p>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
v-bind:class="{
|
||||||
|
'yellow lighten-4': isSelected(props.item),
|
||||||
|
'py-2': true,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<p class="body-2">{{ props.item.patientFullname }}</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
</v-data-table>
|
||||||
|
</v-card>
|
||||||
|
<v-card class="pa-2">
|
||||||
|
<div class="text-xs-left">
|
||||||
|
<v-pagination v-model="page" :length="totalPage"></v-pagination>
|
||||||
|
</div>
|
||||||
|
</v-card>
|
||||||
|
<!-- <one-dialog-print-label
|
||||||
|
:title="printtitle"
|
||||||
|
:width="printwidth"
|
||||||
|
:height="500"
|
||||||
|
:status="openprint"
|
||||||
|
:urlprint="urlprint"
|
||||||
|
@close-dialog-print="closePrint"
|
||||||
|
></one-dialog-print-label> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
.searchbox .v-input.v-text-field .v-input__slot {
|
||||||
|
min-height: 60px;
|
||||||
|
}
|
||||||
|
.searchbox .v-btn {
|
||||||
|
min-height: 60px;
|
||||||
|
}
|
||||||
|
table.v-table tbody td,
|
||||||
|
table.v-table tbody th {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.v-table thead tr {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
.scroll-container {
|
||||||
|
scroll-padding: 50px 0 0 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this targets the default scrollbar (compulsory) */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background-color: #73baf3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the new scrollbar will have a flat appearance with the set background color */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #2196f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this will style the thumb, ignoring the track */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-button {
|
||||||
|
background-color: #0079da;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-corner {
|
||||||
|
background-color: black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
// const { data } = require("./onePriceHeader.vue");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
components: {
|
||||||
|
"one-dialog-print-label": httpVueLoader(
|
||||||
|
"../../common/oneDialogPrintX.vue"
|
||||||
|
),
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$store.dispatch("resume/getsetup");
|
||||||
|
this.$store.dispatch("resume/getFitnessCategory");
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
closePrint() {
|
||||||
|
this.openprint = false;
|
||||||
|
},
|
||||||
|
print() {
|
||||||
|
let user = one_user();
|
||||||
|
var d = new Date();
|
||||||
|
var n = d.getTime();
|
||||||
|
// https://cpone.aplikasi.web.id/birt/run?__report=report/one/rekap/rpt_mcu_patient_label.rptdesign&__format=pdf&PStartDate=2024-07-15&PEndDate=2024-07-15&PMcuID=61&PType=divisi&username=joko@gmail.com&tm=1721657764454
|
||||||
|
let rptname = "rpt_mcu_patient_label";
|
||||||
|
this.urlprint =
|
||||||
|
"/birt/run?__report=report/one/rekap/" +
|
||||||
|
rptname +
|
||||||
|
".rptdesign&__format=pdf" +
|
||||||
|
"&PStartDate=" +
|
||||||
|
this.startDate +
|
||||||
|
"&PEndDate=" +
|
||||||
|
this.endDate +
|
||||||
|
"&PMcuID=" +
|
||||||
|
this.selectedSetup.Mgm_McuID +
|
||||||
|
"&PType=" +
|
||||||
|
this.selectedLabelType.toLowerCase() +
|
||||||
|
"&username=" +
|
||||||
|
user.M_StaffName +
|
||||||
|
"&tm=" +
|
||||||
|
n;
|
||||||
|
this.openprint = true;
|
||||||
|
},
|
||||||
|
formatDate(date) {
|
||||||
|
if (!date) return null;
|
||||||
|
|
||||||
|
const [year, month, day] = date.split("-");
|
||||||
|
return `${day}-${month}-${year}`;
|
||||||
|
},
|
||||||
|
deFormatedDate(date) {
|
||||||
|
if (!date) return null;
|
||||||
|
|
||||||
|
const [day, month, year] = date.split("-");
|
||||||
|
return `${year}-${month.padStart(2, "0")}-${day.padStart(2, "0")}`;
|
||||||
|
},
|
||||||
|
selectMe(val) {
|
||||||
|
if (this.loading || this.loadingDetail || this.loadingSave) {
|
||||||
|
this.snackbarWarning = true;
|
||||||
|
this.warningMsg =
|
||||||
|
"Loading sedang berlangsung, silahkan tunggu loading selesai untuk memilih pasien lain";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// this.loading = true;
|
||||||
|
this.$store.commit("resume/reset_input");
|
||||||
|
this.selectedPatient = val;
|
||||||
|
this.patientDetail = {
|
||||||
|
detail: [],
|
||||||
|
puasaStatus: null,
|
||||||
|
puasaLabel: ""
|
||||||
|
};
|
||||||
|
this.$store.dispatch("resume/getdetail");
|
||||||
|
},
|
||||||
|
isSelected(val) {
|
||||||
|
return this.selectedPatient.orderID === val.orderID;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
errorMsg: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.errorMsg;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_errorMsg", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
successMsg: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.successMsg;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_successMsg", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
snackbarError: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.snackbarError;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_snackbarError", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
snackbarSuccess: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.snackbarSuccess;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_snackbarSuccess", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
setupList: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.setupList;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_setupList", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selectedSetup: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.selectedSetup;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_selectedSetup", val);
|
||||||
|
this.selectedPatient = {};
|
||||||
|
this.patientDetail = {
|
||||||
|
detail: [],
|
||||||
|
puasaStatus: null,
|
||||||
|
puasaLabel: ""
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
startDate: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.startDate;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_startDate", val);
|
||||||
|
this.selectedPatient = {};
|
||||||
|
this.patientDetail = {
|
||||||
|
detail: [],
|
||||||
|
puasaStatus: null,
|
||||||
|
puasaLabel: ""
|
||||||
|
};
|
||||||
|
this.page = 1;
|
||||||
|
if (!this.changeSetup) this.$store.dispatch("resume/search");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
endDate: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.endDate;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.selectedPatient = {};
|
||||||
|
this.patientDetail = {
|
||||||
|
detail: [],
|
||||||
|
puasaStatus: null,
|
||||||
|
puasaLabel: ""
|
||||||
|
};
|
||||||
|
this.page = 1;
|
||||||
|
this.$store.commit("resume/update_endDate", val);
|
||||||
|
if (!this.changeSetup) this.$store.dispatch("resume/search");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
patientDetail: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.patientDetail;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_patientDetail", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
search: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.search;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.selectedPatient = {};
|
||||||
|
this.patientDetail = {
|
||||||
|
detail: [],
|
||||||
|
puasaStatus: null,
|
||||||
|
puasaLabel: ""
|
||||||
|
};
|
||||||
|
this.page = 1;
|
||||||
|
this.$store.commit("resume/update_search", val);
|
||||||
|
if (!this.changeSetup) this.$store.dispatch("resume/search");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
patientList: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.patientList;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_patientList", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selectedPatient: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.selectedPatient;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_selectedPatient", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
totalPage: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.totalPage;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_totalPage", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
page: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.page;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.selectedPatient = {};
|
||||||
|
this.patientDetail = {
|
||||||
|
detail: [],
|
||||||
|
puasaStatus: null,
|
||||||
|
puasaLabel: ""
|
||||||
|
};
|
||||||
|
this.$store.commit("resume/update_page", val);
|
||||||
|
if (!this.changeSetup) this.$store.dispatch("resume/search");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.loading;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_loading", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
loadingSave: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.loadingSave;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_loadingSave", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
loadingDetail: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.loadingDetail;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_loadingDetail", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
formatedStartDate() {
|
||||||
|
return this.formatDate(this.startDate);
|
||||||
|
},
|
||||||
|
formatedEndDate() {
|
||||||
|
return this.formatDate(this.endDate);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
selectedSetup(val, old) {
|
||||||
|
this.changeSetup = true;
|
||||||
|
this.page = 1;
|
||||||
|
this.endDate = val.Mgm_McuEndDate;
|
||||||
|
this.startDate = val.Mgm_McuStartDate;
|
||||||
|
this.$store.dispatch("resume/search");
|
||||||
|
this.changeSetup = false;
|
||||||
|
},
|
||||||
|
selectedLabelType(val, old) {
|
||||||
|
let user = one_user();
|
||||||
|
var d = new Date();
|
||||||
|
var n = d.getTime();
|
||||||
|
// https://cpone.aplikasi.web.id/birt/run?__report=report/one/rekap/rpt_mcu_patient_label.rptdesign&__format=pdf&PStartDate=2024-07-15&PEndDate=2024-07-15&PMcuID=61&PType=divisi&username=joko@gmail.com&tm=1721657764454
|
||||||
|
let rptname = "rpt_mcu_patient_label";
|
||||||
|
this.urlprint =
|
||||||
|
"/birt/run?__report=report/one/rekap/" +
|
||||||
|
rptname +
|
||||||
|
".rptdesign&__format=pdf" +
|
||||||
|
"&PStartDate=" +
|
||||||
|
this.startDate +
|
||||||
|
"&PEndDate=" +
|
||||||
|
this.endDate +
|
||||||
|
"&PMcuID=" +
|
||||||
|
this.selectedSetup.Mgm_McuID +
|
||||||
|
"&PType=" +
|
||||||
|
val.toLowerCase() +
|
||||||
|
"&username=" +
|
||||||
|
user.M_StaffName +
|
||||||
|
"&tm=" +
|
||||||
|
n;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
menuFormDateStart: false,
|
||||||
|
menuFormDateEnd: false,
|
||||||
|
changeSetup: false,
|
||||||
|
printtitle: "",
|
||||||
|
printwidth: "80%",
|
||||||
|
openprint: false,
|
||||||
|
urlprint: "",
|
||||||
|
selectedLabelType: "Departement",
|
||||||
|
LabelTypeList: ["Departement", "Divisi"],
|
||||||
|
snackbarWarning: false,
|
||||||
|
warningMsg: "",
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
text: "NO REG",
|
||||||
|
align: "left",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "20%",
|
||||||
|
class: "pa-2 blue lighten-3 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "TGL. ORDER",
|
||||||
|
align: "left",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "30%",
|
||||||
|
class: "pa-2 blue lighten-3 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "PASIEN",
|
||||||
|
align: "left",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "50%",
|
||||||
|
class: "pa-2 blue lighten-3 white--text",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
File diff suppressed because it is too large
Load Diff
101
test/vuex/one-mcu-resume-individu-cponev8/index.php
Normal file
101
test/vuex/one-mcu-resume-individu-cponev8/index.php
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>CPOne</title>
|
||||||
|
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
|
||||||
|
<link rel="stylesheet" href="../../../libs/vendor/css/icomoon-fonts.css">
|
||||||
|
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div v-cloak id="app">
|
||||||
|
<v-app id="smartApp">
|
||||||
|
<one-navbar></one-navbar>
|
||||||
|
<v-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 xs4 class="left" fill-height pa-1>
|
||||||
|
<one-resume-left></one-resume-left>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs8 class="right" fill-height pa-1>
|
||||||
|
<one-resume-right></one-resume-right>
|
||||||
|
</v-flex>
|
||||||
|
<!-- <v-flex xs6 class="right" fill-height pa-1> -->
|
||||||
|
<!-- komponen kanan -->
|
||||||
|
<!-- <one-fo-cashier-payment></one-fo-cashier-payment>-->
|
||||||
|
<!-- </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/one_print_barcode.js"></script>
|
||||||
|
<script src="../../../libs/one_print_robo.js"></script> -->
|
||||||
|
<!-- App Script -->
|
||||||
|
<?php
|
||||||
|
$ts = "?ts=" . Date("ymdhis");
|
||||||
|
?>
|
||||||
|
<script type="module">
|
||||||
|
window.calculate_age = function(inp_dob) {
|
||||||
|
var now = moment(new Date())
|
||||||
|
var dob = moment(new Date(inp_dob))
|
||||||
|
var year = now.diff(dob, 'years')
|
||||||
|
dob.add(year, 'years')
|
||||||
|
var month = now.diff(dob, 'months')
|
||||||
|
dob.add(month, 'months')
|
||||||
|
var day = now.diff(dob, 'days')
|
||||||
|
if (isNaN(year)) return ''
|
||||||
|
return `${year} tahun ${month} bulan ${day} hari`
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
import {
|
||||||
|
store
|
||||||
|
} from './store.js<?php echo $ts ?>';
|
||||||
|
//for testing
|
||||||
|
window.store = store;
|
||||||
|
new Vue({
|
||||||
|
store,
|
||||||
|
el: '#app',
|
||||||
|
methods: {
|
||||||
|
tab_selected: function(tab) {
|
||||||
|
return this.$store.state.tab_selected == tab
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||||
|
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||||
|
'one-resume-left': httpVueLoader('./components/oneResumeLeft.vue'),
|
||||||
|
'one-resume-right': httpVueLoader('./components/oneResumeRight.vue'),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
[v-cloak] {
|
||||||
|
display: none
|
||||||
|
}
|
||||||
|
|
||||||
|
.left {}
|
||||||
|
|
||||||
|
.right {}
|
||||||
|
</style>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,992 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<v-dialog persistent v-model="dialogValidasi" width="500">
|
||||||
|
<v-card>
|
||||||
|
<v-card-title class="headline grey lighten-2" primary-title>
|
||||||
|
<v-layout align-center justify-space-between row fill-height>
|
||||||
|
<div>KONFIRMASI</div>
|
||||||
|
</v-layout>
|
||||||
|
</v-card-title>
|
||||||
|
<v-card-text
|
||||||
|
>Apakah anda yakin akan mevalidasi
|
||||||
|
<kbd class="mx-2">{{ selectedPriceHeader.headerCode }}</kbd>
|
||||||
|
<span>{{ selectedPriceHeader.headerName }}</span> ?
|
||||||
|
</v-card-text>
|
||||||
|
<v-divider></v-divider>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn
|
||||||
|
color="error"
|
||||||
|
:disabled="loading"
|
||||||
|
flat
|
||||||
|
@click="dialogValidasi = false"
|
||||||
|
>
|
||||||
|
BATAL
|
||||||
|
</v-btn>
|
||||||
|
<v-btn
|
||||||
|
color="success"
|
||||||
|
:disabled="loading"
|
||||||
|
flat
|
||||||
|
@click="validateHeader()"
|
||||||
|
>
|
||||||
|
YAKIN
|
||||||
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
|
<v-layout class="fill-height" column>
|
||||||
|
<v-layout align-center column>
|
||||||
|
<v-toolbar dark color="primary">
|
||||||
|
<v-toolbar-title class="white--text">
|
||||||
|
<kbd class="mr-2">{{ this.selectedPriceHeader.headerCode }}</kbd>
|
||||||
|
{{ this.selectedPriceHeader.headerName }}</v-toolbar-title
|
||||||
|
>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<!-- v-if="selectedPriceHeader.headerValidate === 'N'" -->
|
||||||
|
<v-btn color="success" :disabled="loading" @click="handleSave()"
|
||||||
|
>Simpan</v-btn
|
||||||
|
>
|
||||||
|
<!-- selectedPriceHeader.headerValidate === 'N' && -->
|
||||||
|
<v-btn
|
||||||
|
:disabled="loading"
|
||||||
|
color="warning"
|
||||||
|
@click="dialogValidasi = true"
|
||||||
|
>Validasi
|
||||||
|
</v-btn>
|
||||||
|
<!-- <v-btn
|
||||||
|
:disabled="loading"
|
||||||
|
v-if="
|
||||||
|
selectedPriceHeader.headerValidate === 'Y' &&
|
||||||
|
selectedPriceHeader.validatePacket === 'Y' &&
|
||||||
|
selectedPriceHeader.readyValidate === 'Y'
|
||||||
|
"
|
||||||
|
color="warning"
|
||||||
|
@click="dialogValidasi = true"
|
||||||
|
>Validasi
|
||||||
|
</v-btn> -->
|
||||||
|
</v-toolbar>
|
||||||
|
<v-card style="width: 100%" class="mb-2 pa-2 searchbox">
|
||||||
|
<v-layout row>
|
||||||
|
<v-flex xs4 class="mr-1">
|
||||||
|
<v-text-field
|
||||||
|
label="Kode/nama"
|
||||||
|
hide-details
|
||||||
|
:loading="loading"
|
||||||
|
v-model="filterName"
|
||||||
|
outline
|
||||||
|
></v-text-field>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs4 class="mr-1 ml-1">
|
||||||
|
<v-autocomplete
|
||||||
|
label="Sub Group"
|
||||||
|
v-model="selectedFilterSubGroup"
|
||||||
|
:items="filterSubGroup"
|
||||||
|
item-text="name"
|
||||||
|
outline
|
||||||
|
hide-details
|
||||||
|
:disabled="loading"
|
||||||
|
return-object
|
||||||
|
:loading="loading"
|
||||||
|
no-data-text="Pilih Sub Group"
|
||||||
|
>
|
||||||
|
<template slot="item" slot-scope="{ item }">
|
||||||
|
<v-list-tile-content>
|
||||||
|
<v-list-tile-title v-text="item.name"></v-list-tile-title>
|
||||||
|
</v-list-tile-content>
|
||||||
|
</template>
|
||||||
|
</v-autocomplete>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs4 class="ml-1">
|
||||||
|
<v-autocomplete
|
||||||
|
label="Status"
|
||||||
|
v-model="selectedFilterStatus"
|
||||||
|
:items="filterStatus"
|
||||||
|
item-text="name"
|
||||||
|
outline
|
||||||
|
hide-details
|
||||||
|
return-object
|
||||||
|
:disabled="loading"
|
||||||
|
:loading="loading"
|
||||||
|
no-data-text="Pilih Status"
|
||||||
|
>
|
||||||
|
<template slot="item" slot-scope="{ item }">
|
||||||
|
<v-list-tile-content>
|
||||||
|
<v-list-tile-title v-text="item.name"></v-list-tile-title>
|
||||||
|
</v-list-tile-content>
|
||||||
|
</template>
|
||||||
|
</v-autocomplete>
|
||||||
|
</v-flex>
|
||||||
|
</v-layout>
|
||||||
|
</v-card>
|
||||||
|
</v-layout>
|
||||||
|
<v-card style="overflow-y: scroll; height: 65vh" class="fill-height">
|
||||||
|
<v-data-table
|
||||||
|
:loading="loading"
|
||||||
|
:items="priceTestList"
|
||||||
|
:headers="headers"
|
||||||
|
class="v-table elevation-1"
|
||||||
|
hide-actions
|
||||||
|
>
|
||||||
|
<template v-slot:headers="props">
|
||||||
|
<tr>
|
||||||
|
<th
|
||||||
|
v-for="header in props.headers"
|
||||||
|
:width="header.width"
|
||||||
|
:class="header.class"
|
||||||
|
>
|
||||||
|
{{ header.text }}
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
<v-progress-linear
|
||||||
|
v-slot:progress="loading"
|
||||||
|
color="blue"
|
||||||
|
:indeterminate="true"
|
||||||
|
></v-progress-linear>
|
||||||
|
<template v-slot:items="props">
|
||||||
|
<tr>
|
||||||
|
<td class="py-2">
|
||||||
|
<div style="color: brown" class="mb-0">
|
||||||
|
<v-btn
|
||||||
|
small
|
||||||
|
color="success"
|
||||||
|
class="white--text"
|
||||||
|
v-if="props.item.status === 'Y'"
|
||||||
|
>
|
||||||
|
<v-icon left dark>check</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
<v-btn
|
||||||
|
small
|
||||||
|
color="error"
|
||||||
|
class="white--text"
|
||||||
|
v-if="props.item.status === 'N'"
|
||||||
|
>
|
||||||
|
<v-icon right dark>close</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="py-2">
|
||||||
|
<!-- v-bind:class="{ 'amber lighten-4': isSelected(props.item) }" -->
|
||||||
|
<p style="" class="mb-1">
|
||||||
|
<kbd class="mr-2">{{ props.item.testCode }}</kbd>
|
||||||
|
<span class="font-weight-bold">
|
||||||
|
{{ props.item.testName }}
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td class="py-2">
|
||||||
|
<!-- v-bind:class="{ 'amber lighten-4': isSelected(props.item) }" -->
|
||||||
|
<v-text-field
|
||||||
|
label="Amount"
|
||||||
|
type="number"
|
||||||
|
v-model="props.item.priceAmount"
|
||||||
|
hide-details
|
||||||
|
:disabled="
|
||||||
|
(selectedPriceHeader.headerValidate === 'Y' &&
|
||||||
|
props.item.status === 'Y') ||
|
||||||
|
loading
|
||||||
|
"
|
||||||
|
@input="handleChangeAmount(props.item)"
|
||||||
|
outline
|
||||||
|
></v-text-field>
|
||||||
|
<!-- v-on:change="handleChangeAmount(props.item.priceAmount)" -->
|
||||||
|
<!-- :rules="[rules.min]" -->
|
||||||
|
</td>
|
||||||
|
<td class="py-2">
|
||||||
|
<v-text-field
|
||||||
|
label="Diskon %"
|
||||||
|
type="number"
|
||||||
|
v-model="props.item.priceDisc"
|
||||||
|
@input="handleChangeDisc(props.item)"
|
||||||
|
:disabled="
|
||||||
|
props.item.priceAmount === NaN ||
|
||||||
|
props.item.priceAmount === null ||
|
||||||
|
props.item.priceAmount === undefined ||
|
||||||
|
props.item.priceAmount <= 0 ||
|
||||||
|
props.item.priceAmount === '' ||
|
||||||
|
(selectedPriceHeader.headerValidate === 'Y' &&
|
||||||
|
props.item.status === 'Y') ||
|
||||||
|
loading
|
||||||
|
"
|
||||||
|
hide-details
|
||||||
|
outline
|
||||||
|
></v-text-field>
|
||||||
|
<!-- :rules="[rules.min, rules.maxPersen]" -->
|
||||||
|
</td>
|
||||||
|
<td class="py-2">
|
||||||
|
<!-- v-bind:class="{ 'amber lighten-4': isSelected(props.item) }" -->
|
||||||
|
<v-text-field
|
||||||
|
label="Diskon Rp"
|
||||||
|
type="number"
|
||||||
|
v-model="props.item.priceDiscRp"
|
||||||
|
@input="handleChangeDiscRp(props.item)"
|
||||||
|
:disabled="
|
||||||
|
props.item.priceAmount === NaN ||
|
||||||
|
props.item.priceAmount === null ||
|
||||||
|
props.item.priceAmount === undefined ||
|
||||||
|
props.item.priceAmount <= 0 ||
|
||||||
|
props.item.priceAmount === '' ||
|
||||||
|
(selectedPriceHeader.headerValidate === 'Y' &&
|
||||||
|
props.item.status === 'Y') ||
|
||||||
|
loading
|
||||||
|
"
|
||||||
|
hide-details
|
||||||
|
outline
|
||||||
|
></v-text-field>
|
||||||
|
<!-- :rules="[rules.min]" -->
|
||||||
|
</td>
|
||||||
|
<td class="py-2">
|
||||||
|
<!-- v-bind:class="{ 'amber lighten-4': isSelected(props.item) }" -->
|
||||||
|
<v-text-field
|
||||||
|
label="Total"
|
||||||
|
type="number"
|
||||||
|
readonly
|
||||||
|
v-model="props.item.subTotal"
|
||||||
|
hide-details
|
||||||
|
outline
|
||||||
|
></v-text-field>
|
||||||
|
<!-- :rules="[rules.min]" -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
</v-data-table>
|
||||||
|
</v-card>
|
||||||
|
<v-card class="pa-2">
|
||||||
|
<div class="text-xs-left">
|
||||||
|
<v-pagination
|
||||||
|
v-model="priceTestPage"
|
||||||
|
:length="priceTestPageTotal"
|
||||||
|
></v-pagination>
|
||||||
|
</div>
|
||||||
|
</v-card>
|
||||||
|
</v-layout>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
.searchbox .v-input.v-text-field .v-input__slot {
|
||||||
|
min-height: 60px;
|
||||||
|
}
|
||||||
|
.searchbox .v-btn {
|
||||||
|
min-height: 60px;
|
||||||
|
}
|
||||||
|
table.v-table tbody td,
|
||||||
|
table.v-table tbody th {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.v-table thead tr {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
.scroll-container {
|
||||||
|
scroll-padding: 50px 0 0 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this targets the default scrollbar (compulsory) */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background-color: #73baf3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the new scrollbar will have a flat appearance with the set background color */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #2196f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this will style the thumb, ignoring the track */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-button {
|
||||||
|
background-color: #0079da;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-corner {
|
||||||
|
background-color: black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
// const { data } = require("./onePriceHeader.vue");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
// components: {
|
||||||
|
// "one-dialog-info": httpVueLoader("../../common/oneDialogInfo.vue"),
|
||||||
|
// "one-dialog-alert": httpVueLoader("../../common/oneDialogAlert.vue"),
|
||||||
|
// },
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
closeDialogQrCode() {
|
||||||
|
this.dialogQrCode = false;
|
||||||
|
},
|
||||||
|
handleChangeAmount(data) {
|
||||||
|
console.log(data);
|
||||||
|
// priceAmount
|
||||||
|
// priceDisc
|
||||||
|
// priceDiscRp
|
||||||
|
// subTotal
|
||||||
|
// testID
|
||||||
|
if (data.priceAmount.trim() === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
data.isChange = "Y";
|
||||||
|
cek = parseFloat(data.priceAmount);
|
||||||
|
if (isNaN(cek)) {
|
||||||
|
data.subTotal = 0;
|
||||||
|
alert("Inputan tes " + data.testName + "harus berupa angka");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (parseFloat(data.priceAmount) < 0) {
|
||||||
|
alert(" price amount test " + data.testName + "Kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
amount = parseFloat(data.priceAmount);
|
||||||
|
diskon = 0;
|
||||||
|
if (
|
||||||
|
data.priceDisc !== "" &&
|
||||||
|
data.priceDisc !== null &&
|
||||||
|
data.priceDisc !== "0" &&
|
||||||
|
data.priceDisc !== 0
|
||||||
|
) {
|
||||||
|
diskon = parseFloat(data.priceDisc);
|
||||||
|
}
|
||||||
|
|
||||||
|
diskonRp = 0;
|
||||||
|
if (
|
||||||
|
data.priceDiscRp !== "" &&
|
||||||
|
data.priceDiscRp !== null &&
|
||||||
|
data.priceDiscRp !== "0" &&
|
||||||
|
data.priceDiscRp !== 0
|
||||||
|
) {
|
||||||
|
diskonRp = parseFloat(data.priceDiscRp);
|
||||||
|
}
|
||||||
|
total = 0;
|
||||||
|
if (data.subTotal !== "" && data.subTotal !== null) {
|
||||||
|
total = parseFloat(data.subTotal);
|
||||||
|
}
|
||||||
|
let newTotal = 0;
|
||||||
|
|
||||||
|
diskonAmount = (diskon / 100) * amount;
|
||||||
|
newTotal = amount - diskonAmount - diskonRp;
|
||||||
|
|
||||||
|
console.log("new total");
|
||||||
|
console.log(newTotal);
|
||||||
|
if (newTotal < 0) {
|
||||||
|
alert("Total tes " + data.testName + " tidak boleh kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (newTotal == NaN) {
|
||||||
|
newTotal = 0;
|
||||||
|
}
|
||||||
|
data.subTotal = newTotal;
|
||||||
|
},
|
||||||
|
handleChangeDisc(data) {
|
||||||
|
data.isChange = "Y";
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
|
// data.priceDiscRp = 0;
|
||||||
|
// priceAmount
|
||||||
|
// priceDisc
|
||||||
|
// priceDiscRp
|
||||||
|
// subTotal
|
||||||
|
// testID
|
||||||
|
if (data.priceDisc.trim() === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cek = parseFloat(data.priceDisc);
|
||||||
|
if (isNaN(cek)) {
|
||||||
|
alert("Inputan tes " + data.testName + "harus berupa angka");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (parseFloat(data.priceAmount) < 0) {
|
||||||
|
alert(" price amount test " + data.testName + "Kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
amount = parseFloat(data.priceAmount);
|
||||||
|
diskon = 0;
|
||||||
|
if (
|
||||||
|
data.priceDisc !== "" &&
|
||||||
|
data.priceDisc !== null &&
|
||||||
|
data.priceDisc !== "0" &&
|
||||||
|
data.priceDisc !== 0
|
||||||
|
) {
|
||||||
|
diskon = parseFloat(data.priceDisc);
|
||||||
|
}
|
||||||
|
if (diskon < 0 || diskon > 100) {
|
||||||
|
alert(
|
||||||
|
"Diskon tes " +
|
||||||
|
data.testName +
|
||||||
|
" tidak boleh kurang dari 0 dan tidak boleh lebih dari 100"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
diskonRp = 0;
|
||||||
|
if (
|
||||||
|
data.priceDiscRp !== "" &&
|
||||||
|
data.priceDiscRp !== null &&
|
||||||
|
data.priceDiscRp !== "0" &&
|
||||||
|
data.priceDiscRp !== 0
|
||||||
|
) {
|
||||||
|
diskonRp = parseFloat(data.priceDiscRp);
|
||||||
|
}
|
||||||
|
total = 0;
|
||||||
|
if (data.subTotal !== "" && data.subTotal !== null) {
|
||||||
|
total = parseFloat(data.subTotal);
|
||||||
|
}
|
||||||
|
let newTotal = 0;
|
||||||
|
|
||||||
|
diskonAmount = (diskon / 100) * amount;
|
||||||
|
newTotal = amount - diskonAmount - diskonRp;
|
||||||
|
|
||||||
|
if (newTotal < 0) {
|
||||||
|
alert("Total tes " + data.testName + " tidak boleh kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log("new total");
|
||||||
|
console.log(newTotal);
|
||||||
|
if (newTotal < 0) {
|
||||||
|
alert(
|
||||||
|
"Total tes " +
|
||||||
|
data.testName +
|
||||||
|
" tidak boleh kurang dari price amount"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (newTotal == NaN) {
|
||||||
|
newTotal = 0;
|
||||||
|
}
|
||||||
|
data.subTotal = newTotal;
|
||||||
|
},
|
||||||
|
handleChangeDiscRp(data) {
|
||||||
|
data.isChange = "Y";
|
||||||
|
if (data.priceDisc.trim() === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
|
// priceAmount
|
||||||
|
// priceDisc
|
||||||
|
// priceDiscRp
|
||||||
|
// subTotal
|
||||||
|
// testID
|
||||||
|
if (data.priceDiscRp.trim() === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cek = parseFloat(data.priceDiscRp);
|
||||||
|
if (isNaN(cek) && data.priceDiscRp !== "") {
|
||||||
|
alert("Inputan tes " + data.testName + "harus berupa angka");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (parseFloat(data.priceDiscRp) < 0) {
|
||||||
|
alert(" price amount test " + data.testName + "Kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
amount = parseFloat(data.priceAmount);
|
||||||
|
diskon = 0;
|
||||||
|
if (
|
||||||
|
data.priceDisc !== "" &&
|
||||||
|
data.priceDisc !== null &&
|
||||||
|
data.priceDisc !== "0" &&
|
||||||
|
data.priceDisc !== 0
|
||||||
|
) {
|
||||||
|
diskon = parseFloat(data.priceDisc);
|
||||||
|
}
|
||||||
|
|
||||||
|
diskonRp = 0;
|
||||||
|
if (
|
||||||
|
data.priceDiscRp !== "" &&
|
||||||
|
data.priceDiscRp !== null &&
|
||||||
|
data.priceDiscRp !== "0" &&
|
||||||
|
data.priceDiscRp !== 0
|
||||||
|
) {
|
||||||
|
diskonRp = parseFloat(data.priceDiscRp);
|
||||||
|
}
|
||||||
|
if (diskonRp < 0 || diskonRp > amount) {
|
||||||
|
alert(
|
||||||
|
"Diskon tes " +
|
||||||
|
data.testName +
|
||||||
|
" tidak boleh kurang dari 0 dan tidak boleh lebih dari price amount"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
total = 0;
|
||||||
|
if (data.subTotal !== "" && data.subTotal !== null) {
|
||||||
|
total = parseFloat(data.subTotal);
|
||||||
|
}
|
||||||
|
let newTotal = 0;
|
||||||
|
diskonAmount = (diskon / 100) * amount;
|
||||||
|
newTotal = amount - diskonAmount - diskonRp;
|
||||||
|
|
||||||
|
console.log("new total");
|
||||||
|
console.log(newTotal);
|
||||||
|
if (newTotal < 0) {
|
||||||
|
alert("Total tes " + data.testName + " tidak boleh kurang dari 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (newTotal == NaN) {
|
||||||
|
newTotal = 0;
|
||||||
|
}
|
||||||
|
data.subTotal = newTotal;
|
||||||
|
},
|
||||||
|
handleSave() {
|
||||||
|
let submitted = [];
|
||||||
|
data = this.priceTestList;
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
const e = data[i];
|
||||||
|
if (
|
||||||
|
e.priceAmount !== "" &&
|
||||||
|
e.priceAmount !== null &&
|
||||||
|
e.priceAmount !== undefined
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
isNaN(e.priceAmount) ||
|
||||||
|
isNaN(e.priceDisc) ||
|
||||||
|
isNaN(e.priceDiscRp)
|
||||||
|
) {
|
||||||
|
alert("Input test " + e.testName + " salah, mohon ulangi");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
diskon = parseFloat(e.priceDisc);
|
||||||
|
diskonRp = parseFloat(e.priceDiscRp);
|
||||||
|
amount = parseFloat(e.priceAmount);
|
||||||
|
total = parseFloat(e.subTotal);
|
||||||
|
if (diskon > 100) {
|
||||||
|
alert(
|
||||||
|
"Diskon % test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari 100, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskon < 0) {
|
||||||
|
alert(
|
||||||
|
"Diskon % test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskonRp > amount) {
|
||||||
|
alert(
|
||||||
|
"Diskon Rp test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari price amount, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskonRp < 0) {
|
||||||
|
alert(
|
||||||
|
"Diskon Rp test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (total < 0) {
|
||||||
|
alert(
|
||||||
|
"Total test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (total > amount) {
|
||||||
|
console.log(total);
|
||||||
|
console.log(amount);
|
||||||
|
alert(
|
||||||
|
"Total test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari price amount, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.isChange == "Y") {
|
||||||
|
submitted.push(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(submitted);
|
||||||
|
if (submitted.length > 0) {
|
||||||
|
console.log("submitted > 0");
|
||||||
|
this.$store.dispatch("price/savetest", {
|
||||||
|
test: submitted,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("Tidak ada yang perlu disimpan");
|
||||||
|
}
|
||||||
|
// priceAmount
|
||||||
|
// priceDisc
|
||||||
|
// priceDiscRp
|
||||||
|
// subTotal
|
||||||
|
// testID
|
||||||
|
},
|
||||||
|
handleChangeFIlter() {
|
||||||
|
let submitted = [];
|
||||||
|
data = this.priceTestList;
|
||||||
|
if (data !== undefined && data !== null) {
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
const e = data[i];
|
||||||
|
if (
|
||||||
|
e.priceAmount !== "" &&
|
||||||
|
e.priceAmount !== null &&
|
||||||
|
e.priceAmount !== undefined
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
isNaN(e.priceAmount) ||
|
||||||
|
isNaN(e.priceDisc) ||
|
||||||
|
isNaN(e.priceDiscRp)
|
||||||
|
) {
|
||||||
|
alert("Input test " + e.testName + " salah, mohon ulangi");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
diskon = parseFloat(e.priceDisc);
|
||||||
|
diskonRp = parseFloat(e.priceDiscRp);
|
||||||
|
amount = parseFloat(e.priceAmount);
|
||||||
|
total = parseFloat(e.subTotal);
|
||||||
|
if (diskon > 100) {
|
||||||
|
alert(
|
||||||
|
"Diskon % test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari 100, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskon < 0) {
|
||||||
|
alert(
|
||||||
|
"Diskon % test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskonRp > amount) {
|
||||||
|
alert(
|
||||||
|
"Diskon Rp test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari price amount, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (diskonRp < 0) {
|
||||||
|
alert(
|
||||||
|
"Diskon Rp test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (total < 0) {
|
||||||
|
alert(
|
||||||
|
"Total test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh kurang dari 0, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (total > amount) {
|
||||||
|
console.log(total);
|
||||||
|
console.log(amount);
|
||||||
|
alert(
|
||||||
|
"Total test " +
|
||||||
|
e.testName +
|
||||||
|
" Tidak boleh lebih dari price amount, mohon ulangi"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.isChange == "Y") {
|
||||||
|
submitted.push(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(submitted);
|
||||||
|
// priceAmount
|
||||||
|
// priceDisc
|
||||||
|
// priceDiscRp
|
||||||
|
// subTotal
|
||||||
|
// testID
|
||||||
|
return submitted;
|
||||||
|
},
|
||||||
|
validateHeader() {
|
||||||
|
this.$store.dispatch("price/validateheader");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
filterName: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.filterName;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
let dt = this.handleChangeFIlter();
|
||||||
|
if (dt !== undefined && dt !== null) {
|
||||||
|
if (dt.length > 0) {
|
||||||
|
if (
|
||||||
|
confirm(
|
||||||
|
"Data belum belum tersimpan, Apakah anda yakin untuk melanjutkan ?"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
this.$store.commit("price/update_filterName", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$store.commit("price/update_filterName", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filterSubGroup: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.filterSubGroup;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_filterSubGroup", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filterStatus: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.filterStatus;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_filterStatus", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selectedFilterSubGroup: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.selectedFilterSubGroup;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
let dt = this.handleChangeFIlter();
|
||||||
|
if (dt !== undefined && dt !== null) {
|
||||||
|
if (dt.length > 0) {
|
||||||
|
if (
|
||||||
|
confirm(
|
||||||
|
"Data belum belum tersimpan, Apakah anda yakin untuk melanjutkan ?"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
this.$store.commit("price/update_selectedFilterSubGroup", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$store.commit("price/update_selectedFilterSubGroup", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selectedFilterStatus: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.selectedFilterStatus;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
let dt = this.handleChangeFIlter();
|
||||||
|
if (dt !== undefined && dt !== null) {
|
||||||
|
if (dt.length > 0) {
|
||||||
|
if (
|
||||||
|
confirm(
|
||||||
|
"Data belum belum tersimpan, Apakah anda yakin untuk melanjutkan ?"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
this.$store.commit("price/update_selectedFilterStatus", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$store.commit("price/update_selectedFilterStatus", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.loading;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_loading", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
errorMsg: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.errorMsg;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_errorMsg", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
snackbarError: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.snackbarError;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_snackbarError", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
snackbarSuccess: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.snackbarSuccess;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_snackbarSuccess", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selectedPriceHeader: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.selectedPriceHeader;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_selectedPriceHeader", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
successMsg: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.successMsg;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_successMsg", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
priceTestList: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.priceTestList;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_priceTestList", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
priceTestPageTotal: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.priceTestPageTotal;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_priceTestPageTotal", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dialogValidasi: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.dialogValidasi;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("price/update_dialogValidasi", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
priceTestPage: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.price.priceTestPage;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
dt = this.handleChangeFIlter();
|
||||||
|
if (dt.length > 0) {
|
||||||
|
if (
|
||||||
|
confirm(
|
||||||
|
"Data belum belum tersimpan, Apakah anda yakin untuk melanjutkan ?"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
this.$store.commit("price/update_priceTestPage", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$store.commit("price/update_priceTestPage", val);
|
||||||
|
this.$store.dispatch("price/searchpricetest");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selected_delivery: {},
|
||||||
|
search_company: "",
|
||||||
|
search_test: "",
|
||||||
|
menufilterdatestart: false,
|
||||||
|
menufilterdateend: false,
|
||||||
|
date: new Date().toISOString().substr(0, 10),
|
||||||
|
items: [],
|
||||||
|
menustartdate: false,
|
||||||
|
menuenddate: false,
|
||||||
|
errors: [],
|
||||||
|
sheet: false,
|
||||||
|
indeterminatex: false,
|
||||||
|
checkednotall: false,
|
||||||
|
bar_chx_all: false,
|
||||||
|
selected_barcode: [],
|
||||||
|
dialogtimeline: false,
|
||||||
|
search_doctor: "",
|
||||||
|
dialogWarning: false,
|
||||||
|
dialogWarningMsg: "",
|
||||||
|
rules: {
|
||||||
|
min: (v) => v > 0 || "Minimum value 1",
|
||||||
|
maxPersen: (v) => v <= 100 || "Maximum value 100",
|
||||||
|
},
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
text: "STATUS",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "10%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "TEST",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "25%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "AMOUNT",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "15%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "DISKON",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "name",
|
||||||
|
width: "15%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "DISKON RP",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "name",
|
||||||
|
width: "15%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "TOTAL",
|
||||||
|
align: "center",
|
||||||
|
sortable: false,
|
||||||
|
value: "status",
|
||||||
|
width: "20%",
|
||||||
|
class: "pa-2 blue darken-2 white--text",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,624 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- :title="printtitle" :width="printwidth" :height="500" :status="openprint"
|
||||||
|
:urlprint="urlprint" @close-dialog-print="closePrint" -->
|
||||||
|
<v-dialog v-model="openprint" width="80%">
|
||||||
|
<v-card>
|
||||||
|
<v-card-title class="headline grey lighten-2" primary-title>
|
||||||
|
Cetak Label
|
||||||
|
</v-card-title>
|
||||||
|
|
||||||
|
<v-card-text>
|
||||||
|
<v-layout wrap align-center>
|
||||||
|
<v-flex xs12>
|
||||||
|
<v-select
|
||||||
|
:items="LabelTypeList"
|
||||||
|
v-model="selectedLabelType"
|
||||||
|
></v-select>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs12>
|
||||||
|
<object :data="urlprint" width="100%" height="500"></object>
|
||||||
|
</v-flex>
|
||||||
|
</v-layout>
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
|
<v-divider></v-divider>
|
||||||
|
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn color="primary" flat @click="closePrint"> Tutup </v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
|
<v-snackbar
|
||||||
|
color="success"
|
||||||
|
v-model="snackbarSuccess"
|
||||||
|
right="right"
|
||||||
|
:timeout="3000"
|
||||||
|
top="top"
|
||||||
|
>
|
||||||
|
{{ successMsg }}
|
||||||
|
<v-btn color="white" flat @click="snackbarSuccess = false"> Close </v-btn>
|
||||||
|
</v-snackbar>
|
||||||
|
<v-snackbar
|
||||||
|
color="warning"
|
||||||
|
v-model="snackbarWarning"
|
||||||
|
right="right"
|
||||||
|
:timeout="3000"
|
||||||
|
top="top"
|
||||||
|
>
|
||||||
|
{{ warningMsg }}
|
||||||
|
<v-btn color="white" flat @click="snackbarWarning = false"> Close </v-btn>
|
||||||
|
</v-snackbar>
|
||||||
|
<v-snackbar
|
||||||
|
color="error"
|
||||||
|
v-model="snackbarError"
|
||||||
|
right="right"
|
||||||
|
:timeout="3000"
|
||||||
|
top="top"
|
||||||
|
>
|
||||||
|
{{ errorMsg }}
|
||||||
|
<v-btn color="white" flat @click="snackbarError = false"> Close </v-btn>
|
||||||
|
</v-snackbar>
|
||||||
|
<v-layout class="fill-height" column>
|
||||||
|
<v-card style="width: 100%;" class="mb-2 pa-2">
|
||||||
|
<v-layout row wrap>
|
||||||
|
<v-flex xs12 class="mb-2">
|
||||||
|
<v-autocomplete
|
||||||
|
label="Pilih Proyek MCU"
|
||||||
|
v-model="selectedSetup"
|
||||||
|
:items="setupList"
|
||||||
|
item-text="Mgm_McuLabel"
|
||||||
|
outline
|
||||||
|
hide-details
|
||||||
|
return-object
|
||||||
|
no-data-text="Pilih Proyek MCU"
|
||||||
|
>
|
||||||
|
<template slot="item" slot-scope="{ item }">
|
||||||
|
<v-list-tile-content>
|
||||||
|
<v-list-tile-title
|
||||||
|
v-text="item.Mgm_McuLabel"
|
||||||
|
></v-list-tile-title>
|
||||||
|
</v-list-tile-content>
|
||||||
|
</template>
|
||||||
|
</v-autocomplete>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs6 class="mb-2">
|
||||||
|
<v-menu
|
||||||
|
v-model="menuFormDateStart"
|
||||||
|
:close-on-content-click="false"
|
||||||
|
:nudge-right="40"
|
||||||
|
lazy
|
||||||
|
transition="scale-transition"
|
||||||
|
offset-y
|
||||||
|
full-width
|
||||||
|
max-width="290px"
|
||||||
|
min-width="290px"
|
||||||
|
>
|
||||||
|
<template v-slot:activator="{ on }">
|
||||||
|
<v-text-field
|
||||||
|
class="mr-2"
|
||||||
|
v-model="formatedStartDate"
|
||||||
|
label="Tanggal Awal"
|
||||||
|
outline
|
||||||
|
hide-details
|
||||||
|
readonly
|
||||||
|
v-on="on"
|
||||||
|
@blur="deFormatedDate(formatedStartDate)"
|
||||||
|
></v-text-field>
|
||||||
|
</template>
|
||||||
|
<v-date-picker
|
||||||
|
v-model="startDate"
|
||||||
|
no-title
|
||||||
|
@input="menuFormDateStart = false"
|
||||||
|
></v-date-picker>
|
||||||
|
</v-menu>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs6 class="mb-2">
|
||||||
|
<v-menu
|
||||||
|
v-model="menuFormDateEnd"
|
||||||
|
:close-on-content-click="false"
|
||||||
|
:nudge-right="40"
|
||||||
|
lazy
|
||||||
|
transition="scale-transition"
|
||||||
|
offset-y
|
||||||
|
full-width
|
||||||
|
max-width="290px"
|
||||||
|
min-width="290px"
|
||||||
|
>
|
||||||
|
<template v-slot:activator="{ on }">
|
||||||
|
<v-text-field
|
||||||
|
class="ml-2"
|
||||||
|
v-model="formatedEndDate"
|
||||||
|
label="Tanggal Akhir"
|
||||||
|
outline
|
||||||
|
readonly
|
||||||
|
hide-details
|
||||||
|
v-on="on"
|
||||||
|
@blur="deFormatedDate(formatedEndDate)"
|
||||||
|
></v-text-field>
|
||||||
|
</template>
|
||||||
|
<v-date-picker
|
||||||
|
v-model="endDate"
|
||||||
|
no-title
|
||||||
|
@input="menuFormDateEnd = false"
|
||||||
|
></v-date-picker>
|
||||||
|
</v-menu>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs12>
|
||||||
|
<v-text-field
|
||||||
|
label="Cari..."
|
||||||
|
outline
|
||||||
|
hide-details
|
||||||
|
v-model="search"
|
||||||
|
></v-text-field>
|
||||||
|
</v-flex>
|
||||||
|
</v-layout>
|
||||||
|
</v-card>
|
||||||
|
</v-layout>
|
||||||
|
<v-layout
|
||||||
|
row
|
||||||
|
wrap
|
||||||
|
v-if="
|
||||||
|
selectedSetup.Mgm_McuID !== null &&
|
||||||
|
selectedSetup.Mgm_McuID !== undefined
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<v-card class="py-2 px-2" style="width: 100%;">
|
||||||
|
<div>
|
||||||
|
<v-btn depressed small @click="print()" color="warning"
|
||||||
|
>Cetak Label</v-btn
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<!-- <span
|
||||||
|
|
||||||
|
class="icon-medium-fill-base-small xs1 white--text blue-grey icon-print"
|
||||||
|
></span> -->
|
||||||
|
</v-card>
|
||||||
|
</v-layout>
|
||||||
|
<v-card style="overflow-y: scroll; height: 55vh;" class="fill-height">
|
||||||
|
<v-data-table
|
||||||
|
:loading="loading"
|
||||||
|
:items="patientList"
|
||||||
|
:headers="headers"
|
||||||
|
class="v-table elevation-1"
|
||||||
|
hide-actions
|
||||||
|
>
|
||||||
|
<template v-slot:headers="props">
|
||||||
|
<tr>
|
||||||
|
<th
|
||||||
|
v-for="header in props.headers"
|
||||||
|
:width="header.width"
|
||||||
|
:class="header.class"
|
||||||
|
>
|
||||||
|
{{ header.text }}
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
<v-progress-linear
|
||||||
|
v-slot:progress="loading"
|
||||||
|
color="blue"
|
||||||
|
:indeterminate="true"
|
||||||
|
></v-progress-linear>
|
||||||
|
<template v-slot:items="props">
|
||||||
|
<tr @click="selectMe(props.item)">
|
||||||
|
<!-- 'deep-orange darken-1': props.item.status !== 'NEW', -->
|
||||||
|
<td
|
||||||
|
v-bind:class="{
|
||||||
|
'yellow lighten-4': isSelected(props.item),
|
||||||
|
'py-2 align-center text-sm-left': true,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<!-- <v-layout
|
||||||
|
align-start
|
||||||
|
justify-start
|
||||||
|
row
|
||||||
|
fill-height
|
||||||
|
class="text-sm-left"
|
||||||
|
>
|
||||||
|
<v-flex v-if="props.item.status !== 'NEW'" xs3
|
||||||
|
><v-icon color="success" right>check_circle</v-icon>
|
||||||
|
</v-flex>
|
||||||
|
<v-flex xs9>
|
||||||
|
</v-flex>
|
||||||
|
</v-layout> -->
|
||||||
|
<p
|
||||||
|
v-bind:class="{
|
||||||
|
'green--text': props.item.status !== 'NEW',
|
||||||
|
}"
|
||||||
|
class="font-weight-bold body-2"
|
||||||
|
>
|
||||||
|
{{ props.item.labNumber }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
v-bind:class="{
|
||||||
|
'yellow lighten-4': isSelected(props.item),
|
||||||
|
'py-2': true,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<p class="body-2">{{ props.item.orderDate }}</p>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
v-bind:class="{
|
||||||
|
'yellow lighten-4': isSelected(props.item),
|
||||||
|
'py-2': true,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<p class="body-2">{{ props.item.patientFullname }}</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
</v-data-table>
|
||||||
|
</v-card>
|
||||||
|
<v-card class="pa-2">
|
||||||
|
<div class="text-xs-left">
|
||||||
|
<v-pagination v-model="page" :length="totalPage"></v-pagination>
|
||||||
|
</div>
|
||||||
|
</v-card>
|
||||||
|
<!-- <one-dialog-print-label
|
||||||
|
:title="printtitle"
|
||||||
|
:width="printwidth"
|
||||||
|
:height="500"
|
||||||
|
:status="openprint"
|
||||||
|
:urlprint="urlprint"
|
||||||
|
@close-dialog-print="closePrint"
|
||||||
|
></one-dialog-print-label> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
.searchbox .v-input.v-text-field .v-input__slot {
|
||||||
|
min-height: 60px;
|
||||||
|
}
|
||||||
|
.searchbox .v-btn {
|
||||||
|
min-height: 60px;
|
||||||
|
}
|
||||||
|
table.v-table tbody td,
|
||||||
|
table.v-table tbody th {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.v-table thead tr {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
.scroll-container {
|
||||||
|
scroll-padding: 50px 0 0 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this targets the default scrollbar (compulsory) */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background-color: #73baf3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the new scrollbar will have a flat appearance with the set background color */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #2196f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this will style the thumb, ignoring the track */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-button {
|
||||||
|
background-color: #0079da;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
|
||||||
|
|
||||||
|
::-webkit-scrollbar-corner {
|
||||||
|
background-color: black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
// const { data } = require("./onePriceHeader.vue");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
components: {
|
||||||
|
"one-dialog-print-label": httpVueLoader(
|
||||||
|
"../../common/oneDialogPrintX.vue"
|
||||||
|
),
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$store.dispatch("resume/getsetup");
|
||||||
|
this.$store.dispatch("resume/getFitnessCategory");
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
closePrint() {
|
||||||
|
this.openprint = false;
|
||||||
|
},
|
||||||
|
print() {
|
||||||
|
let user = one_user();
|
||||||
|
var d = new Date();
|
||||||
|
var n = d.getTime();
|
||||||
|
// https://cpone.aplikasi.web.id/birt/run?__report=report/one/rekap/rpt_mcu_patient_label.rptdesign&__format=pdf&PStartDate=2024-07-15&PEndDate=2024-07-15&PMcuID=61&PType=divisi&username=joko@gmail.com&tm=1721657764454
|
||||||
|
let rptname = "rpt_mcu_patient_label";
|
||||||
|
this.urlprint =
|
||||||
|
"/birt/run?__report=report/one/rekap/" +
|
||||||
|
rptname +
|
||||||
|
".rptdesign&__format=pdf" +
|
||||||
|
"&PStartDate=" +
|
||||||
|
this.startDate +
|
||||||
|
"&PEndDate=" +
|
||||||
|
this.endDate +
|
||||||
|
"&PMcuID=" +
|
||||||
|
this.selectedSetup.Mgm_McuID +
|
||||||
|
"&PType=" +
|
||||||
|
this.selectedLabelType.toLowerCase() +
|
||||||
|
"&username=" +
|
||||||
|
user.M_StaffName +
|
||||||
|
"&tm=" +
|
||||||
|
n;
|
||||||
|
this.openprint = true;
|
||||||
|
},
|
||||||
|
formatDate(date) {
|
||||||
|
if (!date) return null;
|
||||||
|
|
||||||
|
const [year, month, day] = date.split("-");
|
||||||
|
return `${day}-${month}-${year}`;
|
||||||
|
},
|
||||||
|
deFormatedDate(date) {
|
||||||
|
if (!date) return null;
|
||||||
|
|
||||||
|
const [day, month, year] = date.split("-");
|
||||||
|
return `${year}-${month.padStart(2, "0")}-${day.padStart(2, "0")}`;
|
||||||
|
},
|
||||||
|
selectMe(val) {
|
||||||
|
if (this.loading || this.loadingDetail || this.loadingSave) {
|
||||||
|
this.snackbarWarning = true;
|
||||||
|
this.warningMsg =
|
||||||
|
"Loading sedang berlangsung, silahkan tunggu loading selesai untuk memilih pasien lain";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// this.loading = true;
|
||||||
|
this.$store.commit("resume/reset_input");
|
||||||
|
this.selectedPatient = val;
|
||||||
|
let tmpDetail = this.patientDetail;
|
||||||
|
tmpDetail.detail = [];
|
||||||
|
this.patientDetail = tmpDetail;
|
||||||
|
this.$store.dispatch("resume/getdetail");
|
||||||
|
},
|
||||||
|
isSelected(val) {
|
||||||
|
return this.selectedPatient.orderID === val.orderID;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
errorMsg: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.errorMsg;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_errorMsg", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
successMsg: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.successMsg;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_successMsg", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
snackbarError: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.snackbarError;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_snackbarError", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
snackbarSuccess: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.snackbarSuccess;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_snackbarSuccess", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
setupList: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.setupList;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_setupList", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selectedSetup: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.selectedSetup;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_selectedSetup", val);
|
||||||
|
this.selectedPatient = {};
|
||||||
|
this.patientDetail = { detail: [] };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
startDate: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.startDate;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_startDate", val);
|
||||||
|
this.selectedPatient = {};
|
||||||
|
this.patientDetail = { detail: [] };
|
||||||
|
this.page = 1;
|
||||||
|
if (!this.changeSetup) this.$store.dispatch("resume/search");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
endDate: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.endDate;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.selectedPatient = {};
|
||||||
|
this.patientDetail = { detail: [] };
|
||||||
|
this.page = 1;
|
||||||
|
this.$store.commit("resume/update_endDate", val);
|
||||||
|
if (!this.changeSetup) this.$store.dispatch("resume/search");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
patientDetail: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.patientDetail;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_patientDetail", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
search: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.search;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.selectedPatient = {};
|
||||||
|
this.patientDetail = { detail: [] };
|
||||||
|
this.page = 1;
|
||||||
|
this.$store.commit("resume/update_search", val);
|
||||||
|
if (!this.changeSetup) this.$store.dispatch("resume/search");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
patientList: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.patientList;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_patientList", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
selectedPatient: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.selectedPatient;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_selectedPatient", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
totalPage: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.totalPage;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_totalPage", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
page: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.page;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.selectedPatient = {};
|
||||||
|
this.patientDetail = { detail: [] };
|
||||||
|
this.$store.commit("resume/update_page", val);
|
||||||
|
if (!this.changeSetup) this.$store.dispatch("resume/search");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
loading: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.loading;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_loading", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
loadingSave: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.loadingSave;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_loadingSave", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
loadingDetail: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.resume.loadingDetail;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.commit("resume/update_loadingDetail", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
formatedStartDate() {
|
||||||
|
return this.formatDate(this.startDate);
|
||||||
|
},
|
||||||
|
formatedEndDate() {
|
||||||
|
return this.formatDate(this.endDate);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
selectedSetup(val, old) {
|
||||||
|
this.changeSetup = true;
|
||||||
|
this.page = 1;
|
||||||
|
this.endDate = val.Mgm_McuEndDate;
|
||||||
|
this.startDate = val.Mgm_McuStartDate;
|
||||||
|
this.$store.dispatch("resume/search");
|
||||||
|
this.changeSetup = false;
|
||||||
|
},
|
||||||
|
selectedLabelType(val, old) {
|
||||||
|
let user = one_user();
|
||||||
|
var d = new Date();
|
||||||
|
var n = d.getTime();
|
||||||
|
// https://cpone.aplikasi.web.id/birt/run?__report=report/one/rekap/rpt_mcu_patient_label.rptdesign&__format=pdf&PStartDate=2024-07-15&PEndDate=2024-07-15&PMcuID=61&PType=divisi&username=joko@gmail.com&tm=1721657764454
|
||||||
|
let rptname = "rpt_mcu_patient_label";
|
||||||
|
this.urlprint =
|
||||||
|
"/birt/run?__report=report/one/rekap/" +
|
||||||
|
rptname +
|
||||||
|
".rptdesign&__format=pdf" +
|
||||||
|
"&PStartDate=" +
|
||||||
|
this.startDate +
|
||||||
|
"&PEndDate=" +
|
||||||
|
this.endDate +
|
||||||
|
"&PMcuID=" +
|
||||||
|
this.selectedSetup.Mgm_McuID +
|
||||||
|
"&PType=" +
|
||||||
|
val.toLowerCase() +
|
||||||
|
"&username=" +
|
||||||
|
user.M_StaffName +
|
||||||
|
"&tm=" +
|
||||||
|
n;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
menuFormDateStart: false,
|
||||||
|
menuFormDateEnd: false,
|
||||||
|
changeSetup: false,
|
||||||
|
printtitle: "",
|
||||||
|
printwidth: "80%",
|
||||||
|
openprint: false,
|
||||||
|
urlprint: "",
|
||||||
|
selectedLabelType: "Departement",
|
||||||
|
LabelTypeList: ["Departement", "Divisi"],
|
||||||
|
snackbarWarning: false,
|
||||||
|
warningMsg: "",
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
text: "NO REG",
|
||||||
|
align: "left",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "20%",
|
||||||
|
class: "pa-2 blue lighten-3 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "TGL. ORDER",
|
||||||
|
align: "left",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "30%",
|
||||||
|
class: "pa-2 blue lighten-3 white--text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "PASIEN",
|
||||||
|
align: "left",
|
||||||
|
sortable: false,
|
||||||
|
value: "lab",
|
||||||
|
width: "50%",
|
||||||
|
class: "pa-2 blue lighten-3 white--text",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
File diff suppressed because it is too large
Load Diff
475
test/vuex/one-mcu-resume-individu-cponev8/modules/price.js
Normal file
475
test/vuex/one-mcu-resume-individu-cponev8/modules/price.js
Normal file
@@ -0,0 +1,475 @@
|
|||||||
|
// 1 => LOADING
|
||||||
|
// 2 => DONE
|
||||||
|
// 3 => ERROR
|
||||||
|
import * as api from "../api/price.js"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
namespaced: true,
|
||||||
|
state: {
|
||||||
|
lookup_status: 0,
|
||||||
|
searchPrice: "",
|
||||||
|
priceHeaderList: [],
|
||||||
|
loading: false,
|
||||||
|
page: 1,
|
||||||
|
totalPageHeader: 0,
|
||||||
|
errorMsg: '',
|
||||||
|
snackbarSuccess: false,
|
||||||
|
snackbarError: false,
|
||||||
|
successMsg: '',
|
||||||
|
selectedPriceHeader: {
|
||||||
|
"headerID": "0",
|
||||||
|
"headerName": "",
|
||||||
|
"headerStartDate": "",
|
||||||
|
"headerEndDate": "",
|
||||||
|
"headerCode": "CODE"
|
||||||
|
},
|
||||||
|
dialogPriceHeader: false,
|
||||||
|
dialogDeleteHeader: false,
|
||||||
|
startDateHeader: moment(new Date()).format('YYYY-MM-DD'),
|
||||||
|
endDateHeader: moment(new Date()).format('YYYY-MM-DD'),
|
||||||
|
nameHeader: "",
|
||||||
|
filterName: "",
|
||||||
|
filterSubGroup: [],
|
||||||
|
filterStatus: [],
|
||||||
|
selectedFilterSubGroup: {
|
||||||
|
"id": "0",
|
||||||
|
'name': 'Semua'
|
||||||
|
},
|
||||||
|
selectedFilterStatus: {
|
||||||
|
"id": "A",
|
||||||
|
'name': 'Semua'
|
||||||
|
},
|
||||||
|
priceTestList: [],
|
||||||
|
priceTestPageTotal: 0,
|
||||||
|
priceTestPage: 1,
|
||||||
|
priceHeaderCopyList: [],
|
||||||
|
selectedPriceHeaderCopy: {},
|
||||||
|
dialogCopyHarga: false,
|
||||||
|
copyPacket: false,
|
||||||
|
dialogValidasi: false,
|
||||||
|
},
|
||||||
|
mutations: {
|
||||||
|
update_lookup_status(state, val) {
|
||||||
|
state.lookup_status = val
|
||||||
|
},
|
||||||
|
update_searchPrice(state, val) {
|
||||||
|
state.searchPrice = val
|
||||||
|
},
|
||||||
|
update_priceHeaderList(state, val) {
|
||||||
|
state.priceHeaderList = val
|
||||||
|
},
|
||||||
|
update_loading(state, val) {
|
||||||
|
state.loading = val
|
||||||
|
},
|
||||||
|
update_page(state, val) {
|
||||||
|
state.page = val
|
||||||
|
},
|
||||||
|
update_totalPageHeader(state, val) {
|
||||||
|
state.totalPageHeader = val
|
||||||
|
},
|
||||||
|
update_errorMsg(state, val) {
|
||||||
|
state.errorMsg = val
|
||||||
|
},
|
||||||
|
update_snackbarSuccess(state, val) {
|
||||||
|
state.snackbarSuccess = val
|
||||||
|
},
|
||||||
|
update_snackbarError(state, val) {
|
||||||
|
state.snackbarError = val
|
||||||
|
},
|
||||||
|
update_successMsg(state, val) {
|
||||||
|
state.successMsg = val
|
||||||
|
},
|
||||||
|
update_selectedPriceHeader(state, val) {
|
||||||
|
state.selectedPriceHeader = val
|
||||||
|
},
|
||||||
|
update_dialogPriceHeader(state, val) {
|
||||||
|
state.dialogPriceHeader = val
|
||||||
|
},
|
||||||
|
update_startDateHeader(state, val) {
|
||||||
|
state.startDateHeader = val
|
||||||
|
},
|
||||||
|
update_endDateHeader(state, val) {
|
||||||
|
state.endDateHeader = val
|
||||||
|
},
|
||||||
|
update_nameHeader(state, val) {
|
||||||
|
state.nameHeader = val
|
||||||
|
},
|
||||||
|
update_dialogDeleteHeader(state, val) {
|
||||||
|
state.dialogDeleteHeader = val
|
||||||
|
},
|
||||||
|
update_filterName(state, val) {
|
||||||
|
state.filterName = val
|
||||||
|
},
|
||||||
|
update_filterStatus(state, val) {
|
||||||
|
state.filterStatus = val
|
||||||
|
},
|
||||||
|
update_filterSubGroup(state, val) {
|
||||||
|
state.filterSubGroup = val
|
||||||
|
},
|
||||||
|
update_selectedFilterStatus(state, val) {
|
||||||
|
state.selectedFilterStatus = val
|
||||||
|
},
|
||||||
|
update_selectedFilterSubGroup(state, val) {
|
||||||
|
state.selectedFilterSubGroup = val
|
||||||
|
},
|
||||||
|
update_priceTestList(state, val) {
|
||||||
|
state.priceTestList = val
|
||||||
|
},
|
||||||
|
update_priceTestPageTotal(state, val) {
|
||||||
|
state.priceTestPageTotal = val
|
||||||
|
},
|
||||||
|
update_priceTestPage(state, val) {
|
||||||
|
state.priceTestPage = val
|
||||||
|
},
|
||||||
|
update_priceHeaderCopyList(state, val) {
|
||||||
|
state.priceHeaderCopyList = val
|
||||||
|
},
|
||||||
|
update_selectedPriceHeaderCopy(state, val) {
|
||||||
|
state.selectedPriceHeaderCopy = val
|
||||||
|
},
|
||||||
|
update_dialogCopyHarga(state, val) {
|
||||||
|
state.dialogCopyHarga = val
|
||||||
|
},
|
||||||
|
update_copyPacket(state, val) {
|
||||||
|
state.copyPacket = val
|
||||||
|
},
|
||||||
|
update_dialogValidasi(state, val) {
|
||||||
|
state.dialogValidasi = val
|
||||||
|
},
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
async searchPriceHeader(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
token: one_token(),
|
||||||
|
page: context.state.page,
|
||||||
|
search: context.state.searchPrice
|
||||||
|
}
|
||||||
|
let resp = await api.search(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
context.commit("update_snackbarError", false)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
records: resp.data.records,
|
||||||
|
total: resp.data.total
|
||||||
|
}
|
||||||
|
context.commit("update_priceHeaderList", resp.data.records)
|
||||||
|
if (resp.data.records.length > 0 && context.state.selectedPriceHeader.headerID === "0") {
|
||||||
|
context.commit("update_selectedPriceHeader", resp.data.records[0])
|
||||||
|
context.dispatch("searchpricetest")
|
||||||
|
// this.$store.dispatch("price/searchpricetest");
|
||||||
|
|
||||||
|
} else if (resp.data.records.length > 0 && context.state.selectedPriceHeader.headerID !== "0") {
|
||||||
|
for (let i = 0; i < resp.data.records.length; i++) {
|
||||||
|
const e = resp.data.records[i];
|
||||||
|
if (e.headerID === context.state.selectedPriceHeader.headerID) {
|
||||||
|
context.commit("update_selectedPriceHeader", e)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
context.commit("update_totalPageHeader", resp.data.total)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
context.commit("update_snackbarError", false)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async insertPriceHeader(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
token: one_token(),
|
||||||
|
name: context.state.nameHeader,
|
||||||
|
sd: context.state.startDateHeader,
|
||||||
|
ed: context.state.endDateHeader
|
||||||
|
}
|
||||||
|
let resp = await api.insertheader(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_successMsg", 'Berhasil Membuat Harga ' + context.state.nameHeader)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_snackbarSuccess", true)
|
||||||
|
context.commit("update_dialogPriceHeader", false)
|
||||||
|
context.commit("update_nameHeader", '')
|
||||||
|
context.dispatch("searchPriceHeader")
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async editPriceHeader(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
id: context.state.selectedPriceHeader.headerID,
|
||||||
|
token: one_token(),
|
||||||
|
name: context.state.nameHeader,
|
||||||
|
sd: context.state.startDateHeader,
|
||||||
|
ed: context.state.endDateHeader
|
||||||
|
}
|
||||||
|
let resp = await api.editheader(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_successMsg", 'Berhasil Edit Harga ' + context.state.nameHeader)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_snackbarSuccess", true)
|
||||||
|
context.commit("update_dialogPriceHeader", false)
|
||||||
|
context.commit("update_nameHeader", '')
|
||||||
|
context.dispatch("searchPriceHeader")
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async deletePriceHeader(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
id: context.state.selectedPriceHeader.headerID,
|
||||||
|
token: one_token(),
|
||||||
|
}
|
||||||
|
let resp = await api.deleteheader(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_successMsg", 'Berhasil Hapus Harga ' + context.state.nameHeader)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_snackbarSuccess", true)
|
||||||
|
context.commit("update_dialogDeleteHeader", false)
|
||||||
|
context.commit("update_nameHeader", '')
|
||||||
|
context.dispatch("searchPriceHeader")
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getpricefilter(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
token: one_token(),
|
||||||
|
}
|
||||||
|
let resp = await api.getfilterprice(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
|
||||||
|
|
||||||
|
context.commit("update_filterStatus", resp.data.status)
|
||||||
|
context.commit("update_filterSubGroup", resp.data.subgroup)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async searchpricetest(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
token: one_token(),
|
||||||
|
search: context.state.filterName,
|
||||||
|
subgroup: context.state.selectedFilterSubGroup.id,
|
||||||
|
status: context.state.selectedFilterStatus.id,
|
||||||
|
headerid: context.state.selectedPriceHeader.headerID,
|
||||||
|
page: context.state.priceTestPage,
|
||||||
|
}
|
||||||
|
let resp = await api.searchpricetest(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_priceTestList", resp.data.records)
|
||||||
|
context.commit("update_priceTestPageTotal", resp.data.total)
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async savetest(context, prm) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
prm.token = one_token();
|
||||||
|
prm.headerid = context.state.selectedPriceHeader.headerID
|
||||||
|
|
||||||
|
let resp = await api.savetest(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_snackbarError", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_successMsg", 'Berhasil simpan harga')
|
||||||
|
context.commit("update_snackbarSuccess", false)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.dispatch("searchpricetest");
|
||||||
|
context.dispatch("searchPriceHeader");
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async copyharga(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
token: one_token(),
|
||||||
|
headerid: context.state.selectedPriceHeaderCopy.headerID,
|
||||||
|
name: context.state.nameHeader,
|
||||||
|
copypacket: context.state.copyPacket
|
||||||
|
}
|
||||||
|
|
||||||
|
let resp = await api.copyharga(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
context.commit("update_snackbarError", false)
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_successMsg", 'Berhasil copy harga')
|
||||||
|
context.commit("update_snackbarSuccess", false)
|
||||||
|
context.dispatch("searchPriceHeader");
|
||||||
|
context.commit("update_dialogCopyHarga", false)
|
||||||
|
context.commit("update_nameHeader", '')
|
||||||
|
context.commit("update_selectedPriceHeaderCopy", {})
|
||||||
|
context.commit("update_copyPacket", false)
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async validateheader(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
token: one_token(),
|
||||||
|
id: context.state.selectedPriceHeader.headerID,
|
||||||
|
}
|
||||||
|
|
||||||
|
let resp = await api.validateheader(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_successMsg", 'Berhasil validasi price header')
|
||||||
|
context.commit("update_snackbarSuccess", false)
|
||||||
|
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_dialogValidasi", false)
|
||||||
|
context.dispatch("searchPriceHeader");
|
||||||
|
context.dispatch("searchpricetest");
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async searchPriceHeaderAutocomplete(context, prm) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
try {
|
||||||
|
prm.token = one_token();
|
||||||
|
prm.headerid = context.state.selectedPriceHeader.headerID
|
||||||
|
|
||||||
|
let resp = await api.searchpricetestautocomplete(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_priceHeaderCopyList", resp.data.records)
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
460
test/vuex/one-mcu-resume-individu-cponev8/modules/resume.js
Normal file
460
test/vuex/one-mcu-resume-individu-cponev8/modules/resume.js
Normal file
@@ -0,0 +1,460 @@
|
|||||||
|
// 1 => LOADING
|
||||||
|
// 2 => DONE
|
||||||
|
// 3 => ERROR
|
||||||
|
import * as api from "../api/resume.js"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
namespaced: true,
|
||||||
|
state: {
|
||||||
|
lookup_status: 0,
|
||||||
|
loading: false,
|
||||||
|
setupList: [],
|
||||||
|
selectedSetup: {},
|
||||||
|
startDate: moment(new Date()).format('YYYY-MM-DD'),
|
||||||
|
endDate: moment(new Date()).format('YYYY-MM-DD'),
|
||||||
|
search: '',
|
||||||
|
errorMsg: '',
|
||||||
|
snackbarSuccess: false,
|
||||||
|
snackbarError: false,
|
||||||
|
successMsg: '',
|
||||||
|
patientList: [],
|
||||||
|
selectedPatient: {},
|
||||||
|
totalPage: 0,
|
||||||
|
page: 1,
|
||||||
|
patientDetail: {
|
||||||
|
detail: [],
|
||||||
|
puasaStatus: null,
|
||||||
|
puasaLabel: ""
|
||||||
|
},
|
||||||
|
rekomendasi: '',
|
||||||
|
recomendation: '',
|
||||||
|
saran: '',
|
||||||
|
advice: '',
|
||||||
|
conclusion: '',
|
||||||
|
kesimpulan: '',
|
||||||
|
doctorList: [],
|
||||||
|
selectedDoctor: {},
|
||||||
|
searchDoctor: '',
|
||||||
|
dialogDoctor: false,
|
||||||
|
loadingSave: false,
|
||||||
|
loadingDetail: false,
|
||||||
|
fitnessCategory: [],
|
||||||
|
selectedFitnessCategory: 0,
|
||||||
|
dialogFitness: false,
|
||||||
|
dataFitness: {
|
||||||
|
"status": {
|
||||||
|
"name": "",
|
||||||
|
"name_eng": "",
|
||||||
|
"level": ""
|
||||||
|
},
|
||||||
|
"data": []
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mutations: {
|
||||||
|
update_dialogFitness(state, val) {
|
||||||
|
state.dialogFitness = val
|
||||||
|
},
|
||||||
|
update_dataFitness(state, val) {
|
||||||
|
state.dataFitness = val
|
||||||
|
},
|
||||||
|
update_selectedFitnessCategory(state, val) {
|
||||||
|
state.selectedFitnessCategory = val
|
||||||
|
},
|
||||||
|
update_fitnessCategory(state, val) {
|
||||||
|
state.fitnessCategory = val
|
||||||
|
},
|
||||||
|
update_lookup_status(state, val) {
|
||||||
|
state.lookup_status = val
|
||||||
|
},
|
||||||
|
update_loading(state, val) {
|
||||||
|
state.loading = val
|
||||||
|
},
|
||||||
|
update_setupList(state, val) {
|
||||||
|
state.setupList = val
|
||||||
|
},
|
||||||
|
update_selectedSetup(state, val) {
|
||||||
|
state.selectedSetup = val
|
||||||
|
},
|
||||||
|
update_startDate(state, val) {
|
||||||
|
state.startDate = val
|
||||||
|
},
|
||||||
|
update_endDate(state, val) {
|
||||||
|
state.endDate = val
|
||||||
|
},
|
||||||
|
update_search(state, val) {
|
||||||
|
state.search = val
|
||||||
|
},
|
||||||
|
update_errorMsg(state, val) {
|
||||||
|
state.errorMsg = val
|
||||||
|
},
|
||||||
|
update_snackbarSuccess(state, val) {
|
||||||
|
state.snackbarSuccess = val
|
||||||
|
},
|
||||||
|
update_snackbarError(state, val) {
|
||||||
|
state.snackbarError = val
|
||||||
|
},
|
||||||
|
update_successMsg(state, val) {
|
||||||
|
state.successMsg = val
|
||||||
|
},
|
||||||
|
update_patientList(state, val) {
|
||||||
|
state.patientList = val
|
||||||
|
},
|
||||||
|
update_selectedPatient(state, val) {
|
||||||
|
state.selectedPatient = val
|
||||||
|
},
|
||||||
|
update_totalPage(state, val) {
|
||||||
|
state.totalPage = val
|
||||||
|
},
|
||||||
|
update_page(state, val) {
|
||||||
|
state.page = val
|
||||||
|
},
|
||||||
|
update_patientDetail(state, val) {
|
||||||
|
state.patientDetail = val
|
||||||
|
},
|
||||||
|
update_rekomendasi(state, val) {
|
||||||
|
state.rekomendasi = val
|
||||||
|
},
|
||||||
|
update_kesimpulan(state, val) {
|
||||||
|
state.kesimpulan = val
|
||||||
|
},
|
||||||
|
update_conclusion(state, val) {
|
||||||
|
state.conclusion = val
|
||||||
|
},
|
||||||
|
update_recomendation(state, val) {
|
||||||
|
state.recomendation = val
|
||||||
|
},
|
||||||
|
update_advice(state, val) {
|
||||||
|
state.advice = val
|
||||||
|
},
|
||||||
|
update_saran(state, val) {
|
||||||
|
state.saran = val
|
||||||
|
},
|
||||||
|
reset_input(state) {
|
||||||
|
state.kesimpulan = '';
|
||||||
|
state.rekomendasi = '';
|
||||||
|
state.saran = '';
|
||||||
|
state.advice = '';
|
||||||
|
state.conclusion = '';
|
||||||
|
state.recomendation = '';
|
||||||
|
state.patientDetail = {
|
||||||
|
detail: [],
|
||||||
|
puasaStatus: null,
|
||||||
|
puasaLabel: ""
|
||||||
|
};
|
||||||
|
},
|
||||||
|
update_doctorList(state, val) {
|
||||||
|
state.doctorList = val
|
||||||
|
},
|
||||||
|
update_selectedDoctor(state, val) {
|
||||||
|
state.selectedDoctor = val
|
||||||
|
},
|
||||||
|
update_searchDoctor(state, val) {
|
||||||
|
state.searchDoctor = val
|
||||||
|
},
|
||||||
|
update_dialogDoctor(state, val) {
|
||||||
|
state.dialogDoctor = val
|
||||||
|
},
|
||||||
|
update_loadingSave(state, val) {
|
||||||
|
state.loadingSave = val
|
||||||
|
},
|
||||||
|
update_loadingDetail(state, val) {
|
||||||
|
state.loadingDetail = val
|
||||||
|
},
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
async getsetup(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
token: one_token(),
|
||||||
|
}
|
||||||
|
let resp = await api.getsetup(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
records: resp.data.records,
|
||||||
|
total: resp.data.total
|
||||||
|
}
|
||||||
|
context.commit("update_setupList", resp.data.records)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async search(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
token: one_token(),
|
||||||
|
search: context.state.search,
|
||||||
|
page: context.state.page,
|
||||||
|
startDate: context.state.startDate,
|
||||||
|
endDate: context.state.endDate,
|
||||||
|
setupID: context.state.selectedSetup.Mgm_McuID
|
||||||
|
}
|
||||||
|
let resp = await api.search(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
records: resp.data.records,
|
||||||
|
total: resp.data.total
|
||||||
|
}
|
||||||
|
context.commit("update_patientList", resp.data.records)
|
||||||
|
context.commit("update_totalPage", resp.data.total)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getdetail(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loadingDetail", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
token: one_token(),
|
||||||
|
orderid: context.state.selectedPatient.orderID,
|
||||||
|
}
|
||||||
|
let resp = await api.getdetail(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loadingDetail", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
records: resp.data.records,
|
||||||
|
total: resp.data.total
|
||||||
|
}
|
||||||
|
|
||||||
|
context.commit("update_patientDetail", resp.data.header);
|
||||||
|
context.commit("update_selectedFitnessCategory", resp.data.header.fitnessCategory);
|
||||||
|
|
||||||
|
// if (resp.data.records.length > 0) {
|
||||||
|
// context.commit("update_rekomendasi", resp.data.records[0].resumeRekomendasi)
|
||||||
|
// context.commit("update_kesimpulan", resp.data.records[0].resumeKesimpulan)
|
||||||
|
// context.commit("update_saran", resp.data.records[0].resumeSaran)
|
||||||
|
// }
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_loadingDetail", false)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loadingDetail", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getdoctorlist(context, prm) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
// context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
prm.token = one_token()
|
||||||
|
let resp = await api.getdoctor(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
records: resp.data.records,
|
||||||
|
total: resp.data.total
|
||||||
|
}
|
||||||
|
context.commit("update_doctorList", resp.data.records)
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
context.commit("update_snackbarError", false)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getFitnessCategory(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
// context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {};
|
||||||
|
prm.token = one_token()
|
||||||
|
let resp = await api.getFitnessCategory(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
records: resp.data.records,
|
||||||
|
total: resp.data.total
|
||||||
|
}
|
||||||
|
context.commit("update_fitnessCategory", resp.data.records)
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
context.commit("update_snackbarError", false)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async save(context, prm) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loadingSave", true)
|
||||||
|
try {
|
||||||
|
prm.token = one_token()
|
||||||
|
let resp = await api.save(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loadingSave", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
await context.dispatch("search")
|
||||||
|
await context.dispatch("getdetail")
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_snackbarSuccess", true)
|
||||||
|
context.commit("update_successMsg", 'Berhasil Simpan Data')
|
||||||
|
context.commit("update_loadingSave", false)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loadingSave", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async savedoctor(context, prm) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
prm.token = one_token()
|
||||||
|
let resp = await api.savedoctor(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
await context.dispatch("search")
|
||||||
|
await context.dispatch("getdetail")
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_snackbarSuccess", true)
|
||||||
|
context.commit("update_successMsg", 'Berhasil Simpan Data')
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_dialogDoctor", false)
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async generateFitnessCategory(context) {
|
||||||
|
context.commit("update_lookup_status", 1)
|
||||||
|
context.commit("update_loading", true)
|
||||||
|
try {
|
||||||
|
let prm = {
|
||||||
|
token: one_token(),
|
||||||
|
orderid: context.state.selectedPatient.orderID,
|
||||||
|
kesimpulan: context.state.patientDetail.kesimpulan,
|
||||||
|
rekomendasi: context.state.patientDetail.rekomendasi,
|
||||||
|
saran: context.state.patientDetail.saran,
|
||||||
|
conclusion: context.state.patientDetail.conclusion,
|
||||||
|
recomendation: context.state.patientDetail.recomendation,
|
||||||
|
advice: context.state.patientDetail.advice
|
||||||
|
}
|
||||||
|
let resp = await api.generateFitnessCategory(prm)
|
||||||
|
if (resp.status != "OK") {
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", resp.message)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
context.commit("update_lookup_status", 2)
|
||||||
|
context.commit("update_errorMsg", '')
|
||||||
|
context.commit("update_snackbarSuccess", true)
|
||||||
|
context.commit("update_successMsg", 'Berhasil Simpan Data')
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
await context.dispatch("search")
|
||||||
|
await context.dispatch("getdetail")
|
||||||
|
context.commit("update_dialogFitness", true);
|
||||||
|
let a = {};
|
||||||
|
for (let i = 0; i < resp.data.data.length; i++) {
|
||||||
|
resp.data.data[i].Nat_TestName.replace('|', ', ')
|
||||||
|
}
|
||||||
|
|
||||||
|
context.commit("update_dataFitness", resp.data);
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
context.commit("update_lookup_status", 3)
|
||||||
|
context.commit("update_loading", false)
|
||||||
|
context.commit("update_errorMsg", e)
|
||||||
|
context.commit("update_snackbarError", true)
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
28
test/vuex/one-mcu-resume-individu-cponev8/store.js
Normal file
28
test/vuex/one-mcu-resume-individu-cponev8/store.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
// State
|
||||||
|
// data ...
|
||||||
|
// Mutations
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Actions
|
||||||
|
import price from "./modules/price.js";
|
||||||
|
import resume from "./modules/resume.js";
|
||||||
|
import system from "../../../apps/modules/system/system.js";
|
||||||
|
export const store = new Vuex.Store({
|
||||||
|
modules: {
|
||||||
|
resume: resume,
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user