Initial import

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

View File

@@ -0,0 +1,203 @@
const URL = "/one-api/v1/regonline/";
export async function save(prm) {
try {
var resp = await axios.post(URL + 'attribute/addnewattribute', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(token,id) {
try {
var resp = await axios.post(URL + 'attribute/deleteattribute', { id: id ,token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchtest(prm) {
try {
var resp = await axios.post(URL + 'attribute/searchtest',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 searchsubcategory(prm) {
try {
var resp = await axios.post(URL + 'attribute/searchsubcategory',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 searchdistrict(prm) {
try {
var resp = await axios.post(URL + 'attribute/searchdistrict',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 searchkelurahan(prm) {
try {
var resp = await axios.post(URL + 'attribute/searchkelurahan',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcompany(prm) {
try {
var resp = await axios.post(URL + 'attribute/searchcompany',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchmou(prm) {
try {
var resp = await axios.post(URL + 'attribute/searchmou',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchdoctor(prm) {
try {
var resp = await axios.post(URL + 'attribute/searchdoctor',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function lookupbyname(prm) {
try {
var resp = await axios.post(URL + 'attribute/lookupattributebyname', 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 selectaddressdoctor(prm) {
try {
var resp = await axios.post(URL + 'attribute/selectaddressdoctor',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
};
}
}

View File

@@ -0,0 +1,279 @@
const URL = "/one-api/mockup/masterdata/";
export async function lookup(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookup', 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 lookupbybranch(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbybranch', 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 lookupbydistrict(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbydistrict', 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 lookupbykelurahan(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbykelurahan', 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 lookupbyname(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbyname', 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 + 'branchv2/addnewregional', 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 update(prm) {
try {
var resp = await axios.post(URL + 'branchv2/editregional', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(token,id) {
try {
var resp = await axios.post(URL + 'branchv2/deleteregional', { id: id, token:token });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function selectnonlab(token) {
try {
var resp = await axios.post(URL + 'branchv2/selectnonlab',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchbranch(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/searchbranch',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchdoctor(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/searchdoctor',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchinstrument(token,tes) {
try {
var resp = await axios.post(URL + 'branchv2/searchinstrument',{token:token,search:tes});
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 searchtemplate(token,tes) {
try {
var resp = await axios.post(URL + 'branchv2/searchtemplate',{token:token,search:tes});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdistrict(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/getdistrict',{id:prm.M_BranchID,token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getkelurahan(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/getkelurahan',{token:token,id:prm.M_DistrictID});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,851 @@
<template>
<v-layout>
<v-flex xs12>
<v-card class="mb-2" color="white">
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>ATRIBUT PEMERIKSAAN</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormBranch(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
<v-list-tile>
<input type="text" v-model="xsearch" class="textinput" label="Nama Station" placeholder="Cari ..." />
</v-list-tile-content>
</v-list-tile>
</v-layout>
<v-divider></v-divider>
<v-layout row wrap class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="branchs" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.T_TestSasCode">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.T_TestName">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.category">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-icon small class="ml-3" color="primary" @click="editFormBranch(props.item)">edit</v-icon>
<v-icon small class="ml-3" color="error" @click="deleteFormBranch(props.item)">clear</v-icon>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
<template>
<v-layout row justify-center>
<v-dialog v-model="dialogbranch" persistent max-width="750px">
<v-card>
<v-card-title>
<span class="headline">FORM ATRIBUT PEMERIKSAAN</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formregionalbranch" v-model="validbranch" lazy-validation>
<v-layout wrap>
<v-flex xs12>
<v-autocomplete label="Pemeriksaan*" v-model="xautotest" :items="xautotests" :search-input.sync="search_test" auto-select-first
no-filter item-text="T_TestName" return-object no-data-text="Cari Pemeriksaan"
small :rules="regionalRules" required>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.T_TestName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex xs12>
<v-autocomplete label="Kategori*" v-model="xautosubcategory" :items="xautosubcategorys" :search-input.sync="search_subcategory" auto-select-first
no-filter item-text="T_SubCategoryName" return-object no-data-text="Cari Kategori" small
:rules="subcategoryRules" required>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.T_SubCategoryName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormBranch()">Tutup</v-btn>
<v-btn color="blue darken-1" flat @click="saveFormBranch()">Simpan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</v-layout>
</template>
</v-card>
</v-flex>
<one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprint" :urlprint="urlprint" @close-dialog-print="closePrint"></one-dialog-print>
<template>
<v-dialog v-model="dialogdeletealertbranch" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalertbranch}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealertbranch = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlertBranch()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.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;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
components: {
'one-date-picker': httpVueLoader('../../../common/oneDatePicker.vue'),
'one-dialog-print': httpVueLoader('../../../common/oneDialogPrintX.vue')
},
data() {
return {
query: "",
items: [],
openprint: false,
urlprint: '',
printtitle: '',
printwidth: 600,
formatreport: 'pdf',
readonlydefault: false,
page: 1,
xname: '',
xphone: '',
xcode: '',
xaddress: '',
xipaddress: '',
xbasename: '',
xshortattribute: '',
xdescattribute: '',
isdefault: false,
issatellite: false,
search_test: '',
search_subcategory: '',
search_district: '',
search_kelurahan: '',
search_company: '',
search_mou: '',
search_doctor: '',
shortRules: [
v => !!v || 'Atribut Singkat harus diisi'
],
descRules: [
v => !!v || 'Atribut Deskripsi harus diisi'
],
addressRules: [
v => !!v || 'Alamat harus diisi'
],
xipaddressRules: [
v => !!v || 'Alamat IP harus diisi'
],
regionalRules: [
v => !!v || 'Regional harus dipilih'
],
subcategoryRules: [
v => !!v || 'Kategori harus dipilih'
],
districtRules: [
v => !!v || 'Kecamatan harus dipilih'
],
kelurahanRules: [
v => !!v || 'Kelurahan harus dipilih'
],
headers: [{
text: "KODE",
align: "left",
sortable: false,
value: "lab",
width: "5%",
class: "blue lighten-3 white--text"
},
{
text: "PEMERIKSAAN",
align: "left",
sortable: false,
value: "name",
width: "20%",
class: "blue lighten-3 white--text"
},
{
text: "KATEGORI",
align: "left",
sortable: false,
value: "name",
width: "10%",
class: "blue lighten-3 white--text"
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "status",
width: "10%",
class: "blue lighten-3 white--text"
}
],
pagination: {
descending: false,
page: 1,
rowsPerPage: 100,
sortBy: 'M_BranchName ASC',
totalItems: this.$store.state.branch.total_transactions
},
statuss: [{
waktu: '16-07-2019 10:00',
status: 'Order Dibuat',
branch: 'Nagita Slavina'
},
{
waktu: '16-07-2019 11:00',
status: 'Order Dikirim',
branch: 'Nagita Slavina'
},
{
waktu: '16-07-2019 12:00',
status: 'Order dikonfirmasi',
branch: 'Chacha Frederica'
},
{
waktu: '16-07-2019 13:00',
status: 'Telah dibuat Surat Jalan',
branch: 'Chacha Frederica'
},
{
waktu: '16-07-2019 14:00',
status: 'Kurir akan mengambil sampel',
branch: 'Satria Subiantoro'
}
],
color: "success",
validbranch: false,
xid: 0,
isinput: "N",
countprice: 0,
branchbranchid: 0,
branchxname: "",
branchlang: "",
branchtext: "",
isadvance: "N",
branchformatadvance: "",
issenttoregional: "N",
menustartdate: false,
menuenddate: false,
date: new Date().toISOString().substr(0, 10),
dialogdeletealertbranch: false,
dialogverifyalertbranch: false,
dialogreleasealertbranch: false,
alertverify: false,
dialogunreleasealertbranch: false,
dialogunverifyalertbranch: false,
msgalertbranch: ""
};
},
mounted() {
this.$store.dispatch("branch/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
},
computed: {
branchs() {
return this.$store.state.branch.branchs
},
xregional() {
return this.$store.state.regional.selected_regional
},
dialogbranch() {
return this.$store.state.branch.dialog_form_branch
},
xerrors() {
return this.$store.state.branch.errors
},
isLoading() {
return this.$store.state.branch.search_status == 1
},
startComputedDateFormatted() {
return this.formatDate(this.xstartdate)
},
xstartdate: {
get() {
return this.$store.state.branch.startdate
},
set(val) {
this.$store.commit("branch/update_startdate", val)
}
},
endComputedDateFormatted() {
return this.formatDate(this.xenddate)
},
xenddate: {
get() {
return this.$store.state.branch.enddate
},
set(val) {
this.$store.commit("branch/update_enddate", val)
}
},
xautosubcategorys() {
return this.$store.state.branch.autosubcategorys
},
xautosubcategory: {
get() {
return this.$store.state.branch.autosubcategory
},
set(val) {
this.$store.commit("branch/update_autosubcategory", val)
this.$store.dispatch("branch/searchdistrict", {
search: this.search_district,
id: val.T_SubCategoryID
})
}
},
xautodistricts() {
return this.$store.state.branch.autodistricts
},
xautodistrict: {
get() {
return this.$store.state.branch.autodistrict
},
set(val) {
this.$store.commit("branch/update_autodistrict", val)
this.$store.dispatch("branch/searchkelurahan", {
search: this.search_kelurahan,
id: val.M_DistrictID
})
}
},
xautokelurahans() {
return this.$store.state.branch.autokelurahans
},
xautokelurahan: {
get() {
return this.$store.state.branch.autokelurahan
},
set(val) {
this.$store.commit("branch/update_autokelurahan", val)
}
},
xautocompanys() {
return this.$store.state.branch.autocompanys
},
xautocompany: {
get() {
return this.$store.state.branch.autocompany
},
set(val) {
this.$store.commit("branch/update_autocompany", val)
this.$store.dispatch("branch/searchmou", {
search: this.search_mou,
id: val.M_CompanyID
})
}
},
xautomous() {
return this.$store.state.branch.automous
},
xautomou: {
get() {
return this.$store.state.branch.automou
},
set(val) {
this.$store.commit("branch/update_automou", val)
}
},
xautodoctors() {
return this.$store.state.branch.autodoctors
},
xautodoctor: {
get() {
return this.$store.state.branch.autodoctor
},
set(val) {
this.$store.commit("branch/update_autodoctor", val)
this.$store.dispatch("branch/selectaddressdoctor", {
id: val.M_DoctorID
})
}
},
xaddressdoctors() {
return this.$store.state.branch.addressdoctors
},
xaddressdoctor: {
get() {
return this.$store.state.branch.addressdoctor
},
set(val) {
this.$store.commit("branch/update_addressdoctor", val)
}
},
xstatuss() {
return this.$store.state.branch.statuss
},
dialogstatusorder() {
return this.$store.state.branch.dialog_status_order
},
xautotests() {
return this.$store.state.branch.autotests
},
xautotest: {
get() {
return this.$store.state.branch.autotest
},
set(val) {
this.$store.commit("branch/update_autotest", val)
}
},
xsearch: {
get() {
return this.$store.state.branch.x_search
},
set(val) {
this.$store.commit("branch/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.branch.current_page
},
set(val) {
this.$store.commit("branch/update_current_page", val)
this.$store.dispatch("branch/lookupbyname", {
regional: this.$store.state.regional.x_search,
branch: this.xsearch,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.branch.total_data
},
set(val) {
this.$store.commit("branch/update_total_data", val)
}
}
},
methods: {
isSelected(p) {
return p.id == this.$store.state.branch.selected_branch.id
},
selectMe(sc) {
this.$store.commit("branch/update_selected_branch", sc)
},
updateDialogFormBranch() {
this.$store.commit("branch/update_dialog_form_branch", false)
},
updateDialogStatusOrder() {
this.$store.commit("branch/update_dialog_status_order", false)
},
setStatusOrder(val) {
this.$store.commit("branch/update_branchs", {})
this.$store.commit("branch/update_dialog_status_order", true)
this.$store.commit("branch/update_statuss", val.statuss)
},
doPriceList(val) {
console.log(location)
var id = val.id
location.replace("/one-ui/regional/vuex/one-md-price/" + "?id=" + id)
},
doPrice() {
console.log(location)
var id = this.xid
location.replace("/one-ui/regional/vuex/one-md-price/" + "?id=" + id)
},
thr_search_test: _.debounce(function () {
this.$store.dispatch("branch/searchtest", {
tes: this.search_test
})
}, 200),
thr_search_subcategory: _.debounce(function () {
this.$store.dispatch("branch/searchsubcategory", {
search: this.search_subcategory
})
}, 200),
thr_search_district: _.debounce(function () {
this.$store.dispatch("branch/searchdistrict", {
search: this.search_district,
id: this.xautosubcategory.T_SubCategoryID
})
}, 200),
thr_search_kelurahan: _.debounce(function () {
this.$store.dispatch("branch/searchkelurahan", {
search: this.search_kelurahan,
id: this.xautodistrict.M_DistrictID
})
}, 200),
thr_search: _.debounce(function () {
this.$store.dispatch("regional/lookupbyname", {
regional: this.$store.state.regional.x_search,
branch: this.xsearch,
current_page: 1,
lastid: -1
})
this.$store.dispatch("branch/lookupbyname", {
regional: this.$store.state.regional.x_search,
branch: this.xsearch,
current_page: 1,
lastid: -1
})
}, 200),
thr_search_company: _.debounce(function () {
this.$store.dispatch("branch/searchcompany", {
search: this.search_company
})
}, 200),
thr_search_mou: _.debounce(function () {
this.$store.dispatch("branch/searchmou", {
search: this.search_mou,
id: this.xautocompany.M_CompanyID
})
}, 200),
thr_search_doctor: _.debounce(function () {
this.$store.dispatch("branch/searchdoctor", {
search: this.search_doctor
})
}, 200),
searchRegional() {
this.$store.dispatch("branch/lookup", {
id: this.xregional.name === "" ? "0" : this.$store.state.regional.selected_regional
.id,
search: this.xsearch,
current_page: 1,
lastid: -1
})
},
doPrint() {
console.log('doprint')
this.printwidth = 1028
this.printtitle = ""
let branch = one_branch()
var id = this.xid
var d = new Date();
var n = d.getTime()
var rptname = 'regional_price'
var formatrpt = this.formatreport
this.urlprint = "/birt/run?__report=report/one/md/" + rptname +
".rptdesign&__format=" +
formatrpt + "&PBranchID=" + id + "&branchxname=" + branch.M_BranchBranchname +
"&tm=" + n
this.openprint = true
},
closePrint() {
this.openprint = false
},
openFormBranch(val) {
this.xid = val
this.xshortattribute = ''
this.xdescattribute = ''
this.$store.commit("branch/update_autotests", [])
this.$store.commit("branch/update_autotest", {})
this.$store.commit("branch/update_autosubcategorys", [])
this.$store.commit("branch/update_autosubcategory", {})
this.$store.commit("branch/update_dialog_form_branch", true)
},
editFormBranch(val) {
this.xid = val.id
this.xshortattribute = val.T_TestAttributeShortDescription
this.xdescattribute = val.T_TestAttributeDescription
this.$store.commit("branch/update_autotests", [{
T_TestID: val.T_TestID,
T_TestName: val.T_TestName
}])
this.$store.commit("branch/update_autotest", {
T_TestID: val.T_TestID,
T_TestName: val.T_TestName
})
this.$store.commit("branch/update_autosubcategorys", [{
T_SubCategoryID: val.T_SubCategoryID,
T_SubCategoryName: val.T_SubCategoryName
}])
this.$store.commit("branch/update_autosubcategory", {
T_SubCategoryID: val.T_SubCategoryID,
T_SubCategoryName: val.T_SubCategoryName
})
this.$store.commit("branch/update_dialog_form_branch", true)
},
checkError(value) {
var errors = this.$store.state.branch.errors
if (errors.includes(value)) {
return true
} else {
return false
}
},
saveFormBranch() {
if (this.$refs.formregionalbranch.validate()) {
this.$store.dispatch("branch/save", {
xid: this.xid,
testid: this.xautotest ? this.$store.state.branch.autotest.T_TestID :
0,
testname: this.$store.state.branch.autotest.T_TestName,
subcategoryid: this.xautosubcategory ? this.$store.state.branch.autosubcategory.T_SubCategoryID : 0,
categoryid: this.xautosubcategory ? this.$store.state.branch.autosubcategory.T_CategoryID : 0,
sbranch: this.xsearch
})
}
},
set_date2(x) {
this.startdate = x.new_date
},
set_date3(x) {
this.enddate = x.new_date
},
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')}`
},
updateAlert_success(val) {
this.$store.commit("regional/update_alert_success", val)
},
deleteFormBranch(data) {
this.xid = data.id
this.msgalertbranch = "Yakin, mau hapus attribut ini?"
this.dialogdeletealertbranch = true
},
closeDeleteAlertBranch() {
this.$store.dispatch("branch/delete", {
xid: this.xid,
regionalid: this.$store.state.branch.autotest.T_TestID,
regionalname: this.$store.state.branch.autotest.T_TestName,
name: this.xname,
sregional: this.$store.state.regional.x_search,
sbranch: this.xsearch
})
this.dialogdeletealertbranch = false
}
},
watch: {
xsearch(val, old) {
console.log(val)
this.xsearch = val
this.thr_search()
},
search_test(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_test()
},
search_subcategory(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_subcategory()
},
search_district(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_district()
},
search_kelurahan(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_kelurahan()
},
search_company(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_company()
},
search_mou(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_mou()
},
search_doctor(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_doctor()
}
}
}
</script>

View File

@@ -0,0 +1,620 @@
<template>
<v-layout>
<template>
<v-dialog v-model="dialogdeletealert" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalert}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealert = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlert()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogregional" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">FORM REGIONAL</span></v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formregional" v-model="valid" lazy-validation>
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="xname" label="Nama*" :rules="xnameRules" required></v-text-field>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormRegional()">Tutup</v-btn>
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormRegional()">Simpan</v-btn>
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormRegional()">Simpan Perubahan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</template>
<v-flex xs12>
<v-card>
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>REGIONAL</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormRegional(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-snackbar v-model="snackbar" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
{{msgsnackbar}}
<v-btn flat @click="updateAlert_success(false)">
Tutup
</v-btn>
</v-snackbar>
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
<v-list-tile>
<input type="text" v-model="xsearch" class="textinput" label="Nama Station" placeholder="Cari ..." />
</v-list-tile-content>
</v-list-tile>
</v-layout>
<v-divider></v-divider>
<div>
<v-layout row class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="vregionals" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.namex}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-icon small class="ml-3" color="primary" @click="editRegional(props.item)">edit</v-icon>
<v-icon small class="ml-3" color="error" @click="deleteRegional(props.item)">clear</v-icon>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
</div>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.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;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
data() {
return {
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
dialogdeletealert: false,
msgalert: "",
valid: false,
xid: 0,
search_instrument: '',
items: [],
xname: '',
xcode: '',
xnameRules: [
v => !!v || 'Nama harus diisi'
],
instrumentRules: [
v => !!v || 'Instrument harus dipilih'
],
name: '',
isdefault: false,
scode: '',
search_doctor: '',
search_testheader: '',
search_template: '',
page: 1,
headers: [{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
pagination: {
descending: true,
page: 1,
rowsPerPage: 100,
sortBy: 'id DESC',
totalItems: this.$store.state.regional.total_filter_regionals
}
};
},
mounted() {
this.$store.dispatch("branch/selectaddressdoctor", {
id: 0
})
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
this.$store.dispatch("branch/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
},
computed: {
xact() {
return this.$store.state.regional.act
},
xerrors() {
return this.$store.state.regional.errors
},
xshowall() {
return this.$store.state.regional.show_all
},
vregionals() {
return this.$store.state.regional.regionals
},
xtotalregionals() {
return this.$store.state.regional.total_regionals
},
xtotalfilterregionals() {
return this.$store.state.regional.total_filter_regionals
},
xsearch: {
get() {
return this.$store.state.regional.x_search
},
set(val) {
this.$store.commit("regional/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.regional.current_page
},
set(val) {
this.$store.commit("regional/update_current_page", val)
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.regional.total_regionals
},
set(val) {
this.$store.commit("regional/update_total_regionals", val)
}
},
dialogregional() {
return this.$store.state.regional.dialog_form_regional
},
snackbar: {
get() {
return this.$store.state.regional.alert_success
},
set(val) {
this.$store.commit("regional/update_alert_success", val)
}
},
msgsnackbar() {
return this.$store.state.regional.msg_success
},
lookupstatus() {
return this.$store.state.regional.lookup_regional
},
xregionaltypes() {
return this.$store.state.regional.regionaltypes
},
xregionaltype: {
get() {
return this.$store.state.regional.regionaltype
},
set(val) {
this.$store.commit("regional/update_regionaltype", val)
}
},
isLoading() {
return this.$store.state.regional.search_status == 1
},
xnonlabs() {
return this.$store.state.regional.nonlabs
},
xnonlab: {
get() {
return this.$store.state.regional.selected_nonlab
},
set(val) {
this.$store.commit("regional/update_selected_nonlab", val)
}
},
xcities() {
return this.$store.state.regional.cities
},
branchaddress: {
get() {
return this.$store.state.regional.branch_address
},
set(val) {
this.$store.commit("regional/update_branch_address", val)
this.$store.dispatch("regional/getdistrict", this.$store.state.regional.branch_address)
}
},
xdoctors() {
return this.$store.state.regional.doctors
},
doctor: {
get() {
return this.$store.state.regional.doctor
},
set(val) {
this.$store.commit("regional/update_doctor", val)
}
},
xinstruments() {
return this.$store.state.regional.instruments
},
xinstrument: {
get() {
return this.$store.state.regional.instrument
},
set(val) {
this.$store.commit("regional/update_instrument", val)
}
},
xautotemplates() {
return this.$store.state.regional.autotemplates
},
xautotemplate: {
get() {
return this.$store.state.regional.autotemplate
},
set(val) {
this.$store.commit("regional/update_autotemplate", val)
}
},
xdistricts() {
return this.$store.state.regional.districts
},
districtaddress: {
get() {
return this.$store.state.regional.district_address
},
set(val) {
this.$store.commit("regional/update_district_address", val)
this.$store.dispatch("regional/getkelurahan", this.$store.state.regional.district_address)
}
},
xkelurahans() {
return this.$store.state.regional.kelurahans
},
kelurahanaddress: {
get() {
return this.$store.state.regional.kelurahan_address
},
set(val) {
this.$store.commit("regional/update_kelurahan_address", val)
}
}
},
methods: {
updateShowAll(val) {
this.$store.commit("regional/update_show_all", val)
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: this.curr_page,
lastid: -1
})
},
searchRegional() {
this.$store.dispatch("regional/lookup", {
search: this.xsearch,
current_page: 1,
lastid: -1
})
},
isSelected(p) {
return p.id == this.$store.state.regional.selected_regional.id
},
subname(name) {
var xname = name
if (xname.length > 18) {
xname = xname.substring(0, 18) + '...'
}
return xname
},
selectMe(sc) {
this.$store.commit("regional/update_selected_regional", sc)
this.$store.dispatch("branch/lookupbyname", {
regional: this.$store.state.regional.selected_regional.name,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
this.$store.commit("branch/update_autoregionals", [{
S_RegionalID: this.$store.state.regional.selected_regional.id,
S_RegionalName: this.$store.state.regional.selected_regional.name
}])
this.$store.commit("branch/update_autoregional", {
S_RegionalID: this.$store.state.regional.selected_regional.id,
S_RegionalName: this.$store.state.regional.selected_regional.name
})
},
updateDialogFormRegional() {
this.$store.commit("regional/update_dialog_form_regional", false)
},
openFormRegional() {
this.xcode = ""
this.xname = ""
this.isdefault = "N"
this.$refs.formregional.reset()
this.$refs.formregional.resetValidation()
this.$store.commit("regional/update_act", 'new')
this.$store.commit("regional/update_dialog_form_regional", true)
},
thr_search_instrument: _.debounce(function () {
this.$store.dispatch("regional/searchinstrument", {
tes: this.search_instrument
})
}, 2000),
saveFormRegional() {
if (this.$refs.formregional.validate()) {
this.$store.dispatch("regional/save", {
name: this.xname,
sregional: this.xsearch,
sbranch: this.$store.state.branch.x_search
})
}
},
updateFormRegional() {
if (this.$refs.formregional.validate()) {
this.$store.dispatch("regional/update", {
id: this.xid,
name: this.xname,
sregional: this.xsearch,
sbranch: this.$store.state.branch.x_search
})
}
},
updateAlert_success(val) {
this.$store.commit("regional/update_alert_success", val)
},
editRegional(data) {
this.xid = data.id
this.xcode = data.code
this.xname = data.name
this.isdefault = data.S_RegionalIsDefault === 'N' ? false : true
this.$store.commit("regional/update_act", 'edit')
this.$store.commit("regional/update_dialog_form_regional", true)
},
deleteRegional(data) {
this.xid = data.id
var xdata = {
id: data.id,
name: data.name,
branchs: 'xxx'
}
this.$store.commit("regional/update_selected_regional", xdata)
this.msgalert = "Yakin, mau hapus regional " + data.name + " ?"
this.dialogdeletealert = true
},
changeNewRegionalType(value) {
this.readonlytyperegional = value === true ? true : false
this.readonlytyperegionalnew = value === true ? false : true
},
newRegionalType() {
readonlytyperegional: true
readonlytyperegionalnew: false
},
closeDeleteAlert() {
this.$store.dispatch("regional/delete", {
regionalid: this.$store.state.regional.selected_regional.id,
xname: this.$store.state.regional.selected_regional.name,
sregional: this.xsearch,
sbranch: this.$store.state.branch.x_search
})
this.dialogdeletealert = false
},
thr_search: _.debounce(function () {
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
this.$store.dispatch("branch/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
}, 1000)
},
watch: {
xsearch(val, old) {
console.log(val)
this.xsearch = val
this.thr_search()
},
search_instrument(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.regional.update_autocomplete_status == 1) return
this.thr_search_instrument()
}
}
}
</script>

View File

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

View File

@@ -0,0 +1,482 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/branch.js"
export default {
namespaced: true,
state: {
branchs: [],
save_status: 0,
save_error_message: '',
dialog_form_branch: false,
dialog_status_order: false,
lookup_branch: 0,
search_status: 0,
errors: [],
startdate: moment(new Date()).format('YYYY-MM-DD'),
enddate: moment(new Date()).format('YYYY-MM-DD'),
bases: [],
base: {},
omzettypes: [],
omzettype: {},
branchtypes: [],
branchtype: {},
agingtypes: [],
agingtype: {},
statuss: [],
autotests:[],
autotest:{},
autosubcategorys:[],
autosubcategory:{},
autodistricts:[],
autodistrict:{},
autokelurahans:[],
autokelurahan:{},
autocompanys:[],
autocompany:{},
automous:[],
automou:{},
autodoctors:[],
autodoctor:{},
addressdoctors:[],
addressdoctor:{},
current_page:1,
x_search: '',
total_data: 0,
selected_branch: {
name: ""
},
get_data_status: 0,
get_data_error_message: ''
},
mutations: {
update_selected_branch(state, val) {
state.selected_branch = val
},
update_x_search(state, val) {
state.x_search = val
},
update_current_page(state, val) {
state.current_page = val
},
update_total_data(state, val) {
state.total_data = val
},
update_autotests(state,data){
state.autotests = data
},
update_autotest(state,val){
state.autotest = val
},
update_autosubcategorys(state,data){
state.autosubcategorys = data
},
update_autosubcategory(state,val){
state.autosubcategory = val
},
update_autocompanys(state,data){
state.autocompanys = data
},
update_autocompany(state,val){
state.autocompany = val
},
update_automous(state,data){
state.automous = data
},
update_automou(state,val){
state.automou = val
},
update_autodoctors(state,data){
state.autodoctors = data
},
update_autodoctor(state,val){
state.autodoctor = val
},
update_addressdoctors(state,data){
state.addressdoctors = data
},
update_addressdoctor(state,val){
state.addressdoctor = val
},
update_autodistricts(state,data){
state.autodistricts = data
},
update_autodistrict(state,val){
state.autodistrict = val
},
update_autokelurahans(state,data){
state.autokelurahans = data
},
update_autokelurahan(state,val){
state.autokelurahan = val
},
update_errors(state, val) {
state.errors = val
},
update_branchs(state, data) {
state.branchs = data
},
update_save_status(state, val) {
state.save_status = val
},
update_save_error_message(state, val) {
state.save_error_message = val
},
update_dialog_form_branch(state, val) {
state.dialog_form_branch = val
},
update_lookup_branch(state, val) {
state.lookup_branch = val
},
update_startdate(state, val) {
state.startdate = val
},
update_enddate(state, val) {
state.enddate = val
},
update_bases(state, data) {
state.bases = data
},
update_base(state, val) {
state.base = val
},
update_omzettypes(state, data) {
state.omzettypes = data
},
update_omzettype(state, val) {
state.omzettype = val
},
update_branchtypes(state, data) {
state.branchtypes = data
},
update_branchtype(state, val) {
state.branchtype = val
},
update_agingtypes(state, data) {
state.agingtypes = data
},
update_agingtype(state, val) {
state.agingtype = val
},
update_search_status(state, val) {
state.search_status = val
},
update_statuss(state, data) {
state.statuss = data
},
update_dialog_status_order(state, val) {
state.dialog_status_order = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_get_data_error_message(state, val) {
state.get_data_error_message = val
}
},
actions: {
async save(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
var data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("regional/update_alert_success", true, {
root: true
})
context.commit("update_dialog_form_branch", false)
var msg = "Cabang " + prm.name + " Regional " + prm.regionalname + " sudah disimpan dong"
context.commit("regional/update_msg_success", msg, {
root: true
})
context.commit("regional/update_alert_success", true, {
root: true
})
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
current_page: 1,
lastid: -1
})
} else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async lookupx(context, prm) {
context.commit("update_lookup_branch", 1)
try {
let resp = await api.lookupx(one_token(), prm.id)
if (resp.status != "OK") {
context.commit("update_lookup_branch", 3)
} else {
context.commit("update_lookup_branch", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_branchs", data.records)
}
} catch (e) {
context.commit("update_lookup_branch", 3)
}
},
async lookup(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.lookup(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_branchs", data.records)
console.log('status')
console.log(data.records.statuss)
context.commit("update_statuss", data.records.statuss)
context.commit("update_total_data", data.total)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async lookupbyname(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.lookupbyname(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_branchs", data.records)
console.log(data.records)
context.commit("update_total_data", data.total)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async delete(context, prm) {
context.commit("update_save_status", 1)
try {
let resp = await api.xdelete(one_token(), prm.xid)
if (resp.status != "OK") {
context.commit("regional/update_save_status", 3, {
root: true
})
context.commit("regional/update_save_error_message", resp.message, {
root: true
})
} else {
context.commit("regional/update_save_status", 2, {
root: true
})
context.commit("regional/update_save_error_message", resp.message, {
root: true
})
context.commit("regional/update_alert_success", true, {
root: true
})
//context.commit("update_dialog_form_schedule_promise", false)
var msg = "Cabang sudah dihapus dong"
context.commit("regional/update_msg_success", msg, {
root: true
})
context.commit("regional/update_alert_success", true, {
root: true
})
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
current_page: 1,
lastid: -1
})
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async searchtest(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchtest(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autotests",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchsubcategory(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchsubcategory(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autosubcategorys",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchdistrict(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchdistrict(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autodistricts",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchkelurahan(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchkelurahan(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autokelurahans",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchcompany(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchcompany(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autocompanys",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchmou(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchmou(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_automous",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchdoctor(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchdoctor(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autodoctors",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async selectaddressdoctor(context,prm) {
context.commit("update_get_data_status", 1)
try {
prm.token = one_token()
let resp = await api.selectaddressdoctor(prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_addressdoctors", resp.data.records.addressdoctors)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
}
}
}

View File

@@ -0,0 +1,549 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/regional.js"
export default {
namespaced: true,
state: {
last_id: -1,
act: 'new',
lookup_regional: 0,
lookup_error_message: '',
regionals: [],
total_regionals: 0,
total_filter_regionals: 0,
selected_regional: {
name: ""
},
save_status: 0,
save_error_message: '',
dialog_form_regional: false,
dialog_edit_form_regional: false,
alert_success: false,
msg_success: "",
show_all: 'N',
errors: [],
regionaltypes: [],
regionaltype: {},
doctors: [],
doctor: {},
get_data_status: 0,
get_data_error_message: '',
cities: [],
branch_address: {},
autocomplete_status: 0,
search_status: 0,
districts: [],
district_address: {},
kelurahans: [],
kelurahan_address: {},
instruments: [],
instrument: {},
autotemplates: [],
autotemplate: {},
nonlabs: [],
selected_nonlab: {},
current_page:1,
x_search: ''
},
mutations: {
update_x_search(state, val) {
state.x_search = val
},
update_current_page(state, val) {
state.current_page = val
},
update_last_id(state, val) {
state.last_id = val
},
update_act(state, val) {
state.act = val
},
update_errors(state, val) {
state.errors = val
},
update_show_all(state, val) {
state.show_all = val
},
update_lookup_error_message(state, status) {
state.lookup_error_message = status
},
update_lookup_regional(state, status) {
state.lookup_regional = status
},
update_regionals(state, data) {
state.regionals = data.records
state.total_regionals = data.total
state.total_filter_regionals = data.total_filter
},
update_selected_regional(state, val) {
state.selected_regional = val
},
update_save_status(state, val) {
state.save_status = val
},
update_save_error_message(state, val) {
state.save_error_message = val
},
update_dialog_form_regional(state, val) {
state.dialog_form_regional = val
},
update_dialog_edit_form_regional(state, val) {
state.dialog_edit_form_regional = val
},
update_alert_success(state, val) {
state.alert_success = val
},
update_msg_success(state, val) {
state.msg_success = val
},
update_regionaltypes(state, data) {
state.regionaltypes = data
},
update_regionaltype(state, val) {
state.regionaltype = val
},
update_doctors(state, data) {
state.doctors = data
},
update_doctor(state, val) {
state.doctor = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_get_data_error_message(state, val) {
state.get_data_error_message = val
},
update_cities(state, val) {
state.cities = val
},
update_branch_address(state, val) {
state.branch_address = val
},
update_autocomplete_status(state, val) {
state.autocomplete_status = val
},
update_districts(state, val) {
state.districts = val
},
update_district_address(state, val) {
state.district_address = val
},
update_kelurahans(state, val) {
state.kelurahans = val
},
update_kelurahan_address(state, val) {
state.kelurahan_address = val
},
update_instruments(state, data) {
state.instruments = data
},
update_instrument(state, val) {
state.instrument = val
},
update_autotemplates(state, data) {
state.autotemplates = data
},
update_autotemplate(state, val) {
state.autotemplate = val
},
update_nonlabs(state, val) {
state.nonlabs = val
},
update_selected_nonlab(state, val) {
state.selected_nonlab = val
}
},
actions: {
async lookup(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookup(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbybranch(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbybranch(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbydistrict(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbydistrict(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbykelurahan(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbykelurahan(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbyname(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbyname(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
var pat = data.records[0]
if(prm.regional != ""){
context.commit("branch/update_autoregionals", [{
S_RegionalID: pat.S_RegionalID,
S_RegionalName: pat.S_RegionalName
}], { root: true })
context.commit("branch/update_autoregional", {
S_RegionalID: pat.S_RegionalID,
S_RegionalName: pat.S_RegionalName
},{ root: true })
}
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async save(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_save_error_message", resp.message)
var data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_errors", [])
context.commit("update_alert_success", true)
context.commit("update_dialog_form_regional", false)
var msg =" Regional " + prm.name + " sudah tersimpan dong ..."
context.commit("update_msg_success", msg)
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
} else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async update(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.update(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_save_error_message", resp.message)
let data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_alert_success", true)
context.commit("update_dialog_form_regional", false)
var msg = " Regional " + prm.name + " sudah terupdate dong ..."
context.commit("update_msg_success", msg)
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
}else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async delete(context, prm) {
context.commit("update_save_status", 1)
try {
let resp = await api.xdelete(one_token(), prm.regionalid)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_alert_success", true)
var msg = " Regional " + prm.name + " sudah dihapus dong"
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.commit("update_selected_regional", {})
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
}
} catch (e) {
context.commit("update_save_status", 3)
console.log(e)
}
},
async selectnonlab(context) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.selectnonlab(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_nonlabs", resp.data.records.nonlabs)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
},
async selectdoctor(context) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.selectdoctor(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_doctors", resp.data.records.doctors)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
},
async searchbranch(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchbranch(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_cities", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchdoctor(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchdoctor(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_doctors", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchinstrument(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchinstrument(one_token(), prm.tes)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_instruments", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchtemplate(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchtemplate(one_token(), prm.tes)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_autotemplates", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async getdistrict(context, prm) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getdistrict(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_districts", resp.data.records)
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
},
async getkelurahan(context, prm) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getkelurahan(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_kelurahans", resp.data.records)
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
}
}
}

View File

@@ -0,0 +1,25 @@
// State
// data ...
// Mutations
//
//
// Actions
import regional from "./modules/regional.js";
import branch from "./modules/branch.js";
import system from "../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
regional: regional,
branch: branch,
system:system
},
state: {
},
mutations: {
},
actions: {
}
});

View File

@@ -0,0 +1,279 @@
const URL = "/one-api/v1/regonline/";
export async function lookup(prm) {
try {
var resp = await axios.post(URL + 'category/lookup', 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 lookupbysubcategory(prm) {
try {
var resp = await axios.post(URL + 'category/lookupcategorybysubcategory', 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 lookupbydistrict(prm) {
try {
var resp = await axios.post(URL + 'category/lookupcategorybydistrict', 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 lookupbykelurahan(prm) {
try {
var resp = await axios.post(URL + 'category/lookupcategorybykelurahan', 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 lookupbyname(prm) {
try {
var resp = await axios.post(URL + 'category/lookupcategorybyname', 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 + 'category/addnewcategory', 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 update(prm) {
try {
var resp = await axios.post(URL + 'category/editcategory', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(token,id) {
try {
var resp = await axios.post(URL + 'category/deletecategory', { id: id, token:token });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function selectnonlab(token) {
try {
var resp = await axios.post(URL + 'category/selectnonlab',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchsubcategory(token,prm) {
try {
var resp = await axios.post(URL + 'category/searchsubcategory',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchdoctor(token,prm) {
try {
var resp = await axios.post(URL + 'category/searchdoctor',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchinstrument(token,tes) {
try {
var resp = await axios.post(URL + 'category/searchinstrument',{token:token,search:tes});
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 searchtemplate(token,tes) {
try {
var resp = await axios.post(URL + 'category/searchtemplate',{token:token,search:tes});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdistrict(token,prm) {
try {
var resp = await axios.post(URL + 'category/getdistrict',{id:prm.M_SubCategoryID,token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getkelurahan(token,prm) {
try {
var resp = await axios.post(URL + 'category/getkelurahan',{token:token,id:prm.M_DistrictID});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,203 @@
const URL = "/one-api/v1/regonline/";
export async function save(prm) {
try {
var resp = await axios.post(URL + 'category/addnewsubcategory', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(token,id) {
try {
var resp = await axios.post(URL + 'category/deletesubcategory', { id: id ,token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcategory(prm) {
try {
var resp = await axios.post(URL + 'category/searchcategory',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcity(prm) {
try {
var resp = await axios.post(URL + 'category/searchcity',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 searchdistrict(prm) {
try {
var resp = await axios.post(URL + 'category/searchdistrict',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 searchkelurahan(prm) {
try {
var resp = await axios.post(URL + 'category/searchkelurahan',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcompany(prm) {
try {
var resp = await axios.post(URL + 'category/searchcompany',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchmou(prm) {
try {
var resp = await axios.post(URL + 'category/searchmou',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchdoctor(prm) {
try {
var resp = await axios.post(URL + 'category/searchdoctor',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function lookupbyname(prm) {
try {
var resp = await axios.post(URL + 'category/lookupsubcategorybyname', 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 selectaddressdoctor(prm) {
try {
var resp = await axios.post(URL + 'category/selectaddressdoctor',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
};
}
}

View File

@@ -0,0 +1,620 @@
<template>
<v-layout>
<template>
<v-dialog v-model="dialogdeletealert" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalert}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealert = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlert()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogcategory" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">FORM KATEGORI</span></v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formcategory" v-model="valid" lazy-validation>
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="xname" label="Nama*" :rules="xnameRules" required></v-text-field>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormCategory()">Tutup</v-btn>
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormCategory()">Simpan</v-btn>
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormCategory()">Simpan Perubahan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</template>
<v-flex xs12>
<v-card>
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>KATEGORI</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormCategory(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-snackbar v-model="snackbar" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
{{msgsnackbar}}
<v-btn flat @click="updateAlert_success(false)">
Tutup
</v-btn>
</v-snackbar>
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
<v-list-tile>
<input type="text" v-model="xsearch" class="textinput" label="Nama Station" placeholder="Cari ..." />
</v-list-tile-content>
</v-list-tile>
</v-layout>
<v-divider></v-divider>
<div>
<v-layout row class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="vcategorys" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_CategoryName}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-icon small class="ml-3" color="primary" @click="editCategory(props.item)">edit</v-icon>
<v-icon small class="ml-3" color="error" @click="deleteCategory(props.item)">clear</v-icon>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
</div>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.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;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
data() {
return {
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
dialogdeletealert: false,
msgalert: "",
valid: false,
xid: 0,
search_instrument: '',
items: [],
xname: '',
xcode: '',
xnameRules: [
v => !!v || 'Nama harus diisi'
],
instrumentRules: [
v => !!v || 'Instrument harus dipilih'
],
name: '',
isdefault: false,
scode: '',
search_doctor: '',
search_testheader: '',
search_template: '',
page: 1,
headers: [{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
pagination: {
descending: true,
page: 1,
rowsPerPage: 100,
sortBy: 'id DESC',
totalItems: this.$store.state.category.total_filter_categorys
}
};
},
mounted() {
this.$store.dispatch("subcategory/selectaddressdoctor", {
id: 0
})
this.$store.dispatch("category/lookupbyname", {
category: this.xsearch,
subcategory: this.$store.state.subcategory.x_search,
current_page: 1,
lastid: -1
})
this.$store.dispatch("subcategory/lookupbyname", {
category: this.xsearch,
subcategory: this.$store.state.subcategory.x_search,
current_page: 1,
lastid: -1
})
},
computed: {
xact() {
return this.$store.state.category.act
},
xerrors() {
return this.$store.state.category.errors
},
xshowall() {
return this.$store.state.category.show_all
},
vcategorys() {
return this.$store.state.category.categorys
},
xtotalcategorys() {
return this.$store.state.category.total_categorys
},
xtotalfiltercategorys() {
return this.$store.state.category.total_filter_categorys
},
xsearch: {
get() {
return this.$store.state.category.x_search
},
set(val) {
this.$store.commit("category/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.category.current_page
},
set(val) {
this.$store.commit("category/update_current_page", val)
this.$store.dispatch("category/lookupbyname", {
category: this.xsearch,
subcategory: this.$store.state.subcategory.x_search,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.category.total_categorys
},
set(val) {
this.$store.commit("category/update_total_categorys", val)
}
},
dialogcategory() {
return this.$store.state.category.dialog_form_category
},
snackbar: {
get() {
return this.$store.state.category.alert_success
},
set(val) {
this.$store.commit("category/update_alert_success", val)
}
},
msgsnackbar() {
return this.$store.state.category.msg_success
},
lookupstatus() {
return this.$store.state.category.lookup_category
},
xcategorytypes() {
return this.$store.state.category.categorytypes
},
xcategorytype: {
get() {
return this.$store.state.category.categorytype
},
set(val) {
this.$store.commit("category/update_categorytype", val)
}
},
isLoading() {
return this.$store.state.category.search_status == 1
},
xnonlabs() {
return this.$store.state.category.nonlabs
},
xnonlab: {
get() {
return this.$store.state.category.selected_nonlab
},
set(val) {
this.$store.commit("category/update_selected_nonlab", val)
}
},
xcities() {
return this.$store.state.category.cities
},
subcategoryaddress: {
get() {
return this.$store.state.category.subcategory_address
},
set(val) {
this.$store.commit("category/update_subcategory_address", val)
this.$store.dispatch("category/getdistrict", this.$store.state.category.subcategory_address)
}
},
xdoctors() {
return this.$store.state.category.doctors
},
doctor: {
get() {
return this.$store.state.category.doctor
},
set(val) {
this.$store.commit("category/update_doctor", val)
}
},
xinstruments() {
return this.$store.state.category.instruments
},
xinstrument: {
get() {
return this.$store.state.category.instrument
},
set(val) {
this.$store.commit("category/update_instrument", val)
}
},
xautotemplates() {
return this.$store.state.category.autotemplates
},
xautotemplate: {
get() {
return this.$store.state.category.autotemplate
},
set(val) {
this.$store.commit("category/update_autotemplate", val)
}
},
xdistricts() {
return this.$store.state.category.districts
},
districtaddress: {
get() {
return this.$store.state.category.district_address
},
set(val) {
this.$store.commit("category/update_district_address", val)
this.$store.dispatch("category/getkelurahan", this.$store.state.category.district_address)
}
},
xkelurahans() {
return this.$store.state.category.kelurahans
},
kelurahanaddress: {
get() {
return this.$store.state.category.kelurahan_address
},
set(val) {
this.$store.commit("category/update_kelurahan_address", val)
}
}
},
methods: {
updateShowAll(val) {
this.$store.commit("category/update_show_all", val)
this.$store.dispatch("category/lookupbyname", {
category: this.xsearch,
subcategory: this.$store.state.subcategory.x_search,
current_page: this.curr_page,
lastid: -1
})
},
searchCategory() {
this.$store.dispatch("category/lookup", {
search: this.xsearch,
current_page: 1,
lastid: -1
})
},
isSelected(p) {
return p.id == this.$store.state.category.selected_category.id
},
subname(name) {
var xname = name
if (xname.length > 18) {
xname = xname.substring(0, 18) + '...'
}
return xname
},
selectMe(sc) {
this.$store.commit("category/update_selected_category", sc)
this.$store.dispatch("subcategory/lookupbyname", {
category: this.$store.state.category.selected_category.name,
subcategory: this.$store.state.subcategory.x_search,
current_page: 1,
lastid: -1
})
this.$store.commit("subcategory/update_autocategorys", [{
T_CategoryID: this.$store.state.category.selected_category.id,
T_CategoryName: this.$store.state.category.selected_category.name
}])
this.$store.commit("subcategory/update_autocategory", {
T_CategoryID: this.$store.state.category.selected_category.id,
T_CategoryName: this.$store.state.category.selected_category.name
})
},
updateDialogFormCategory() {
this.$store.commit("category/update_dialog_form_category", false)
},
openFormCategory() {
this.xcode = ""
this.xname = ""
this.isdefault = "N"
this.$refs.formcategory.reset()
this.$refs.formcategory.resetValidation()
this.$store.commit("category/update_act", 'new')
this.$store.commit("category/update_dialog_form_category", true)
},
thr_search_instrument: _.debounce(function () {
this.$store.dispatch("category/searchinstrument", {
tes: this.search_instrument
})
}, 2000),
saveFormCategory() {
if (this.$refs.formcategory.validate()) {
this.$store.dispatch("category/save", {
name: this.xname,
scategory: this.xsearch,
ssubcategory: this.$store.state.subcategory.x_search
})
}
},
updateFormCategory() {
if (this.$refs.formcategory.validate()) {
this.$store.dispatch("category/update", {
id: this.xid,
name: this.xname,
scategory: this.xsearch,
ssubcategory: this.$store.state.subcategory.x_search
})
}
},
updateAlert_success(val) {
this.$store.commit("category/update_alert_success", val)
},
editCategory(data) {
this.xid = data.id
this.xcode = data.code
this.xname = data.name
this.isdefault = data.T_CategoryIsDefault === 'N' ? false : true
this.$store.commit("category/update_act", 'edit')
this.$store.commit("category/update_dialog_form_category", true)
},
deleteCategory(data) {
this.xid = data.id
var xdata = {
id: data.id,
name: data.name,
subcategorys: 'xxx'
}
this.$store.commit("category/update_selected_category", xdata)
this.msgalert = "Yakin, mau hapus category " + data.name + " ?"
this.dialogdeletealert = true
},
changeNewCategoryType(value) {
this.readonlytypecategory = value === true ? true : false
this.readonlytypecategorynew = value === true ? false : true
},
newCategoryType() {
readonlytypecategory: true
readonlytypecategorynew: false
},
closeDeleteAlert() {
this.$store.dispatch("category/delete", {
categoryid: this.$store.state.category.selected_category.id,
xname: this.$store.state.category.selected_category.name,
scategory: this.xsearch,
ssubcategory: this.$store.state.subcategory.x_search
})
this.dialogdeletealert = false
},
thr_search: _.debounce(function () {
this.$store.dispatch("category/lookupbyname", {
category: this.xsearch,
subcategory: this.$store.state.subcategory.x_search,
current_page: 1,
lastid: -1
})
this.$store.dispatch("subcategory/lookupbyname", {
category: this.xsearch,
subcategory: this.$store.state.subcategory.x_search,
current_page: 1,
lastid: -1
})
}, 1000)
},
watch: {
xsearch(val, old) {
console.log(val)
this.xsearch = val
this.thr_search()
},
search_instrument(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.category.update_autocomplete_status == 1) return
this.thr_search_instrument()
}
}
}
</script>

View File

@@ -0,0 +1,828 @@
<template>
<v-layout>
<v-flex xs12>
<v-card class="mb-2" color="white">
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>SUB KATEGORI</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormSubCategory(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
<v-list-tile>
<input type="text" v-model="xsearch" class="textinput" label="Nama Station" placeholder="Cari ..." />
</v-list-tile-content>
</v-list-tile>
</v-layout>
<v-divider></v-divider>
<v-layout row wrap class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="subcategorys" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.T_CategoryName">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.T_SubCategoryName">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.T_SubCategoryDescription">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-icon small class="ml-3" color="primary" @click="editFormSubCategory(props.item)">edit</v-icon>
<v-icon small class="ml-3" color="error" @click="deleteFormSubCategory(props.item)">clear</v-icon>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
<template>
<v-layout row justify-center>
<v-dialog v-model="dialogsubcategory" persistent max-width="750px">
<v-card>
<v-card-title>
<span class="headline">FORM SUB KATEGORI</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formcategorysubcategory" v-model="validsubcategory" lazy-validation>
<v-layout wrap>
<v-flex xs12>
<v-autocomplete label="Category*" v-model="xautocategory" :items="xautocategorys" :search-input.sync="search_category" auto-select-first
no-filter item-text="T_CategoryName" return-object no-data-text="Cari Category"
small :rules="categoryRules" required>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.T_CategoryName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex xs12>
<v-text-field v-model="xname" label="Nama*" :rules="xnameRules" required></v-text-field>
</v-flex>
<v-flex xs12>
<v-textarea :rules="descriptionRules" required v-model="xdescription" label="Deskripsi*"></v-textarea>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormSubCategory()">Tutup</v-btn>
<v-btn color="blue darken-1" flat @click="saveFormSubCategory()">Simpan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</v-layout>
</template>
</v-card>
</v-flex>
<one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprint" :urlprint="urlprint" @close-dialog-print="closePrint"></one-dialog-print>
<template>
<v-dialog v-model="dialogdeletealertsubcategory" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalertsubcategory}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealertsubcategory = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlertSubCategory()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.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;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
components: {
'one-date-picker': httpVueLoader('../../../common/oneDatePicker.vue'),
'one-dialog-print': httpVueLoader('../../../common/oneDialogPrintX.vue')
},
data() {
return {
query: "",
items: [],
openprint: false,
urlprint: '',
printtitle: '',
printwidth: 600,
formatreport: 'pdf',
readonlydefault: false,
page: 1,
xname: '',
xphone: '',
xcode: '',
xdescription: '',
xipdescription: '',
xbasename: '',
isdefault: false,
issatellite: false,
search_category: '',
search_city: '',
search_district: '',
search_kelurahan: '',
search_company: '',
search_mou: '',
search_doctor: '',
xnameRules: [
v => !!v || 'Nama harus diisi'
],
xcodeRules: [
v => !!v || 'Kode harus diisi'
],
descriptionRules: [
v => !!v || 'Alamat harus diisi'
],
xipdescriptionRules: [
v => !!v || 'Alamat IP harus diisi'
],
categoryRules: [
v => !!v || 'Category harus dipilih'
],
cityRules: [
v => !!v || 'Kota harus dipilih'
],
districtRules: [
v => !!v || 'Kecamatan harus dipilih'
],
kelurahanRules: [
v => !!v || 'Kelurahan harus dipilih'
],
headers: [{
text: "KATEGORI",
align: "left",
sortable: false,
value: "lab",
width: "5%",
class: "blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "name",
width: "20%",
class: "blue lighten-3 white--text"
},
{
text: "DESKRIPSI",
align: "left",
sortable: false,
value: "name",
width: "30%",
class: "blue lighten-3 white--text"
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "status",
width: "10%",
class: "blue lighten-3 white--text"
}
],
pagination: {
descending: false,
page: 1,
rowsPerPage: 100,
sortBy: 'T_SubCategoryName ASC',
totalItems: this.$store.state.subcategory.total_transactions
},
statuss: [{
waktu: '16-07-2019 10:00',
status: 'Order Dibuat',
subcategory: 'Nagita Slavina'
},
{
waktu: '16-07-2019 11:00',
status: 'Order Dikirim',
subcategory: 'Nagita Slavina'
},
{
waktu: '16-07-2019 12:00',
status: 'Order dikonfirmasi',
subcategory: 'Chacha Frederica'
},
{
waktu: '16-07-2019 13:00',
status: 'Telah dibuat Surat Jalan',
subcategory: 'Chacha Frederica'
},
{
waktu: '16-07-2019 14:00',
status: 'Kurir akan mengambil sampel',
subcategory: 'Satria Subiantoro'
}
],
color: "success",
validsubcategory: false,
xid: 0,
isinput: "N",
countprice: 0,
subcategorysubcategoryid: 0,
subcategoryxname: "",
subcategorylang: "",
subcategorytext: "",
isadvance: "N",
subcategoryformatadvance: "",
issenttocategory: "N",
menustartdate: false,
menuenddate: false,
date: new Date().toISOString().substr(0, 10),
dialogdeletealertsubcategory: false,
dialogverifyalertsubcategory: false,
dialogreleasealertsubcategory: false,
alertverify: false,
dialogunreleasealertsubcategory: false,
dialogunverifyalertsubcategory: false,
msgalertsubcategory: ""
};
},
mounted() {
},
computed: {
subcategorys() {
return this.$store.state.subcategory.subcategorys
},
xcategory() {
return this.$store.state.category.selected_category
},
dialogsubcategory() {
return this.$store.state.subcategory.dialog_form_subcategory
},
xerrors() {
return this.$store.state.subcategory.errors
},
isLoading() {
return this.$store.state.subcategory.search_status == 1
},
startComputedDateFormatted() {
return this.formatDate(this.xstartdate)
},
xstartdate: {
get() {
return this.$store.state.subcategory.startdate
},
set(val) {
this.$store.commit("subcategory/update_startdate", val)
}
},
endComputedDateFormatted() {
return this.formatDate(this.xenddate)
},
xenddate: {
get() {
return this.$store.state.subcategory.enddate
},
set(val) {
this.$store.commit("subcategory/update_enddate", val)
}
},
xautocitys() {
return this.$store.state.subcategory.autocitys
},
xautocity: {
get() {
return this.$store.state.subcategory.autocity
},
set(val) {
this.$store.commit("subcategory/update_autocity", val)
this.$store.dispatch("subcategory/searchdistrict", {
search: this.search_district,
id: val.M_CityID
})
}
},
xautodistricts() {
return this.$store.state.subcategory.autodistricts
},
xautodistrict: {
get() {
return this.$store.state.subcategory.autodistrict
},
set(val) {
this.$store.commit("subcategory/update_autodistrict", val)
this.$store.dispatch("subcategory/searchkelurahan", {
search: this.search_kelurahan,
id: val.M_DistrictID
})
}
},
xautokelurahans() {
return this.$store.state.subcategory.autokelurahans
},
xautokelurahan: {
get() {
return this.$store.state.subcategory.autokelurahan
},
set(val) {
this.$store.commit("subcategory/update_autokelurahan", val)
}
},
xautocompanys() {
return this.$store.state.subcategory.autocompanys
},
xautocompany: {
get() {
return this.$store.state.subcategory.autocompany
},
set(val) {
this.$store.commit("subcategory/update_autocompany", val)
this.$store.dispatch("subcategory/searchmou", {
search: this.search_mou,
id: val.M_CompanyID
})
}
},
xautomous() {
return this.$store.state.subcategory.automous
},
xautomou: {
get() {
return this.$store.state.subcategory.automou
},
set(val) {
this.$store.commit("subcategory/update_automou", val)
}
},
xautodoctors() {
return this.$store.state.subcategory.autodoctors
},
xautodoctor: {
get() {
return this.$store.state.subcategory.autodoctor
},
set(val) {
this.$store.commit("subcategory/update_autodoctor", val)
this.$store.dispatch("subcategory/selectdescriptiondoctor", {
id: val.M_DoctorID
})
}
},
xdescriptiondoctors() {
return this.$store.state.subcategory.descriptiondoctors
},
xdescriptiondoctor: {
get() {
return this.$store.state.subcategory.descriptiondoctor
},
set(val) {
this.$store.commit("subcategory/update_descriptiondoctor", val)
}
},
xstatuss() {
return this.$store.state.subcategory.statuss
},
dialogstatusorder() {
return this.$store.state.subcategory.dialog_status_order
},
xautocategorys() {
return this.$store.state.subcategory.autocategorys
},
xautocategory: {
get() {
return this.$store.state.subcategory.autocategory
},
set(val) {
this.$store.commit("subcategory/update_autocategory", val)
}
},
xsearch: {
get() {
return this.$store.state.subcategory.x_search
},
set(val) {
this.$store.commit("subcategory/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.subcategory.current_page
},
set(val) {
this.$store.commit("subcategory/update_current_page", val)
this.$store.dispatch("subcategory/lookupbyname", {
category: this.$store.state.category.x_search,
subcategory: this.xsearch,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.subcategory.total_data
},
set(val) {
this.$store.commit("subcategory/update_total_data", val)
}
}
},
methods: {
isSelected(p) {
return p.id == this.$store.state.subcategory.selected_subcategory.id
},
selectMe(sc) {
this.$store.commit("subcategory/update_selected_subcategory", sc)
},
updateDialogFormSubCategory() {
this.$store.commit("subcategory/update_dialog_form_subcategory", false)
},
updateDialogStatusOrder() {
this.$store.commit("subcategory/update_dialog_status_order", false)
},
setStatusOrder(val) {
this.$store.commit("subcategory/update_subcategorys", {})
this.$store.commit("subcategory/update_dialog_status_order", true)
this.$store.commit("subcategory/update_statuss", val.statuss)
},
doPriceList(val) {
console.log(location)
var id = val.id
location.replace("/one-ui/category/vuex/one-md-price/" + "?id=" + id)
},
doPrice() {
console.log(location)
var id = this.xid
location.replace("/one-ui/category/vuex/one-md-price/" + "?id=" + id)
},
thr_search_category: _.debounce(function () {
this.$store.dispatch("subcategory/searchcategory", {
tes: this.search_category
})
}, 200),
thr_search_city: _.debounce(function () {
this.$store.dispatch("subcategory/searchcity", {
search: this.search_city
})
}, 200),
thr_search_district: _.debounce(function () {
this.$store.dispatch("subcategory/searchdistrict", {
search: this.search_district,
id: this.xautocity.M_CityID
})
}, 200),
thr_search_kelurahan: _.debounce(function () {
this.$store.dispatch("subcategory/searchkelurahan", {
search: this.search_kelurahan,
id: this.xautodistrict.M_DistrictID
})
}, 200),
thr_search: _.debounce(function () {
this.$store.dispatch("category/lookupbyname", {
category: this.$store.state.category.x_search,
subcategory: this.xsearch,
current_page: 1,
lastid: -1
})
this.$store.dispatch("subcategory/lookupbyname", {
category: this.$store.state.category.x_search,
subcategory: this.xsearch,
current_page: 1,
lastid: -1
})
}, 200),
thr_search_company: _.debounce(function () {
this.$store.dispatch("subcategory/searchcompany", {
search: this.search_company
})
}, 200),
thr_search_mou: _.debounce(function () {
this.$store.dispatch("subcategory/searchmou", {
search: this.search_mou,
id: this.xautocompany.M_CompanyID
})
}, 200),
thr_search_doctor: _.debounce(function () {
this.$store.dispatch("subcategory/searchdoctor", {
search: this.search_doctor
})
}, 200),
searchCategory() {
this.$store.dispatch("subcategory/lookup", {
id: this.xcategory.name === "" ? "0" : this.$store.state.category.selected_category
.id,
search: this.xsearch,
current_page: 1,
lastid: -1
})
},
doPrint() {
console.log('doprint')
this.printwidth = 1028
this.printtitle = ""
let subcategory = one_subcategory()
var id = this.xid
var d = new Date();
var n = d.getTime()
var rptname = 'category_price'
var formatrpt = this.formatreport
this.urlprint = "/birt/run?__report=report/one/md/" + rptname +
".rptdesign&__format=" +
formatrpt + "&PSubCategoryID=" + id + "&subcategoryxname=" + subcategory.T_SubCategorySubCategoryname +
"&tm=" + n
this.openprint = true
},
closePrint() {
this.openprint = false
},
openFormSubCategory(val) {
this.xid = val
this.xname = ''
this.xdescription = ''
this.$store.commit("subcategory/update_dialog_form_subcategory", true)
},
editFormSubCategory(val) {
this.xid = val.id
this.xname = val.T_SubCategoryName
this.xdescription = val.T_SubCategoryDescription
this.$store.commit("subcategory/update_autocategorys", [{
T_CategoryID: val.T_CategoryID,
T_CategoryName: val.T_CategoryName
}])
this.$store.commit("subcategory/update_autocategory", {
T_CategoryID: val.T_CategoryID,
T_CategoryName: val.T_CategoryName
})
this.$store.commit("subcategory/update_dialog_form_subcategory", true)
},
checkError(value) {
var errors = this.$store.state.subcategory.errors
if (errors.includes(value)) {
return true
} else {
return false
}
},
saveFormSubCategory() {
if (this.$refs.formcategorysubcategory.validate()) {
this.$store.dispatch("subcategory/save", {
xid: this.xid,
categoryid: this.xautocategory ? this.$store.state.subcategory.autocategory.T_CategoryID :
0,
categoryname: this.$store.state.subcategory.autocategory.T_CategoryName,
name: this.xname,
description: this.xdescription,
scategory: this.$store.state.category.x_search,
ssubcategory: this.xsearch
})
}
},
set_date2(x) {
this.startdate = x.new_date
},
set_date3(x) {
this.enddate = x.new_date
},
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')}`
},
updateAlert_success(val) {
this.$store.commit("category/update_alert_success", val)
},
deleteFormSubCategory(data) {
this.xid = data.id
this.msgalertsubcategory = "Yakin, mau hapus subcategory ini?"
this.dialogdeletealertsubcategory = true
},
closeDeleteAlertSubCategory() {
this.$store.dispatch("subcategory/delete", {
xid: this.xid,
categoryid: this.$store.state.subcategory.autocategory.T_CategoryID,
categoryname: this.$store.state.subcategory.autocategory.T_CategoryName,
name: this.xname,
scategory: this.$store.state.category.x_search,
ssubcategory: this.xsearch
})
this.dialogdeletealertsubcategory = false
}
},
watch: {
xsearch(val, old) {
console.log(val)
this.xsearch = val
this.thr_search()
},
search_category(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.subcategory.update_autocomplete_status == 1) return
this.thr_search_category()
},
search_city(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.subcategory.update_autocomplete_status == 1) return
this.thr_search_city()
},
search_district(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.subcategory.update_autocomplete_status == 1) return
this.thr_search_district()
},
search_kelurahan(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.subcategory.update_autocomplete_status == 1) return
this.thr_search_kelurahan()
},
search_company(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.subcategory.update_autocomplete_status == 1) return
this.thr_search_company()
},
search_mou(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.subcategory.update_autocomplete_status == 1) return
this.thr_search_mou()
},
search_doctor(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.subcategory.update_autocomplete_status == 1) return
this.thr_search_doctor()
}
}
}
</script>

View File

@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>One</title>
<link rel="stylesheet" href="../../libs/vendor/css/google-fonts.css">
<link rel="stylesheet" href="../../libs/vendor/css/vuetify.min.css">
</head>
<body>
<div v-cloak id="app">
<v-app id="smartApp" >
<one-navbar></one-navbar>
<v-content class="blue lighten-5" >
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
<v-layout row wrap >
<v-flex xs3 class="left" fill-height pa-1>
<!-- komponen kiri -->
<one-md-category-list></one-md-category-list>
</v-flex>
<v-flex xs9 class="left" fill-height pa-1>
<!-- komponen kiri -->
<one-md-subcategory-list></one-md-subcategory-list>
</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>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
import { store } from './store.js<?php echo $ts ?>';
//for testing
// window.store = store;
new Vue({
store,
el: '#app',
components: {
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
'one-md-category-list': httpVueLoader('./components/oneMdCategoryList.vue'),
'one-md-subcategory-list' : httpVueLoader('./components/oneMdSubCategoryList.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,549 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/category.js"
export default {
namespaced: true,
state: {
last_id: -1,
act: 'new',
lookup_category: 0,
lookup_error_message: '',
categorys: [],
total_categorys: 0,
total_filter_categorys: 0,
selected_category: {
name: ""
},
save_status: 0,
save_error_message: '',
dialog_form_category: false,
dialog_edit_form_category: false,
alert_success: false,
msg_success: "",
show_all: 'N',
errors: [],
categorytypes: [],
categorytype: {},
doctors: [],
doctor: {},
get_data_status: 0,
get_data_error_message: '',
cities: [],
subcategory_address: {},
autocomplete_status: 0,
search_status: 0,
districts: [],
district_address: {},
kelurahans: [],
kelurahan_address: {},
instruments: [],
instrument: {},
autotemplates: [],
autotemplate: {},
nonlabs: [],
selected_nonlab: {},
current_page:1,
x_search: ''
},
mutations: {
update_x_search(state, val) {
state.x_search = val
},
update_current_page(state, val) {
state.current_page = val
},
update_last_id(state, val) {
state.last_id = val
},
update_act(state, val) {
state.act = val
},
update_errors(state, val) {
state.errors = val
},
update_show_all(state, val) {
state.show_all = val
},
update_lookup_error_message(state, status) {
state.lookup_error_message = status
},
update_lookup_category(state, status) {
state.lookup_category = status
},
update_categorys(state, data) {
state.categorys = data.records
state.total_categorys = data.total
state.total_filter_categorys = data.total_filter
},
update_selected_category(state, val) {
state.selected_category = val
},
update_save_status(state, val) {
state.save_status = val
},
update_save_error_message(state, val) {
state.save_error_message = val
},
update_dialog_form_category(state, val) {
state.dialog_form_category = val
},
update_dialog_edit_form_category(state, val) {
state.dialog_edit_form_category = val
},
update_alert_success(state, val) {
state.alert_success = val
},
update_msg_success(state, val) {
state.msg_success = val
},
update_categorytypes(state, data) {
state.categorytypes = data
},
update_categorytype(state, val) {
state.categorytype = val
},
update_doctors(state, data) {
state.doctors = data
},
update_doctor(state, val) {
state.doctor = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_get_data_error_message(state, val) {
state.get_data_error_message = val
},
update_cities(state, val) {
state.cities = val
},
update_subcategory_address(state, val) {
state.subcategory_address = val
},
update_autocomplete_status(state, val) {
state.autocomplete_status = val
},
update_districts(state, val) {
state.districts = val
},
update_district_address(state, val) {
state.district_address = val
},
update_kelurahans(state, val) {
state.kelurahans = val
},
update_kelurahan_address(state, val) {
state.kelurahan_address = val
},
update_instruments(state, data) {
state.instruments = data
},
update_instrument(state, val) {
state.instrument = val
},
update_autotemplates(state, data) {
state.autotemplates = data
},
update_autotemplate(state, val) {
state.autotemplate = val
},
update_nonlabs(state, val) {
state.nonlabs = val
},
update_selected_nonlab(state, val) {
state.selected_nonlab = val
}
},
actions: {
async lookup(context, prm) {
context.commit("update_lookup_category", 1)
try {
prm.token = one_token()
let resp = await api.lookup(prm)
if (resp.status != "OK") {
context.commit("update_lookup_category", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_category", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_categorys", data)
}
} catch (e) {
context.commit("update_lookup_category", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbysubcategory(context, prm) {
context.commit("update_lookup_category", 1)
try {
prm.token = one_token()
let resp = await api.lookupbysubcategory(prm)
if (resp.status != "OK") {
context.commit("update_lookup_category", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_category", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_categorys", data)
}
} catch (e) {
context.commit("update_lookup_category", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbydistrict(context, prm) {
context.commit("update_lookup_category", 1)
try {
prm.token = one_token()
let resp = await api.lookupbydistrict(prm)
if (resp.status != "OK") {
context.commit("update_lookup_category", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_category", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_categorys", data)
}
} catch (e) {
context.commit("update_lookup_category", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbykelurahan(context, prm) {
context.commit("update_lookup_category", 1)
try {
prm.token = one_token()
let resp = await api.lookupbykelurahan(prm)
if (resp.status != "OK") {
context.commit("update_lookup_category", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_category", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_categorys", data)
}
} catch (e) {
context.commit("update_lookup_category", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbyname(context, prm) {
context.commit("update_lookup_category", 1)
try {
prm.token = one_token()
let resp = await api.lookupbyname(prm)
if (resp.status != "OK") {
context.commit("update_lookup_category", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_category", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_categorys", data)
var pat = data.records[0]
if(prm.category != ""){
context.commit("subcategory/update_autocategorys", [{
S_CategoryID: pat.S_CategoryID,
S_CategoryName: pat.S_CategoryName
}], { root: true })
context.commit("subcategory/update_autocategory", {
S_CategoryID: pat.S_CategoryID,
S_CategoryName: pat.S_CategoryName
},{ root: true })
}
}
} catch (e) {
context.commit("update_lookup_category", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async save(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_save_error_message", resp.message)
var data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_errors", [])
context.commit("update_alert_success", true)
context.commit("update_dialog_form_category", false)
var msg =" Category " + prm.name + " sudah tersimpan dong ..."
context.commit("update_msg_success", msg)
context.dispatch("lookupbyname", {
category: prm.scategory,
subcategory: prm.ssubcategory,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
} else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async update(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.update(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_save_error_message", resp.message)
let data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_alert_success", true)
context.commit("update_dialog_form_category", false)
var msg = " Category " + prm.name + " sudah terupdate dong ..."
context.commit("update_msg_success", msg)
context.dispatch("lookupbyname", {
category: prm.scategory,
subcategory: prm.ssubcategory,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
}else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async delete(context, prm) {
context.commit("update_save_status", 1)
try {
let resp = await api.xdelete(one_token(), prm.categoryid)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_alert_success", true)
var msg = " Category " + prm.name + " sudah dihapus dong"
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.commit("update_selected_category", {})
context.dispatch("lookupbyname", {
category: prm.scategory,
subcategory: prm.ssubcategory,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
}
} catch (e) {
context.commit("update_save_status", 3)
console.log(e)
}
},
async selectnonlab(context) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.selectnonlab(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_nonlabs", resp.data.records.nonlabs)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
},
async selectdoctor(context) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.selectdoctor(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_doctors", resp.data.records.doctors)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
},
async searchsubcategory(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchsubcategory(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_cities", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchdoctor(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchdoctor(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_doctors", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchinstrument(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchinstrument(one_token(), prm.tes)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_instruments", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchtemplate(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchtemplate(one_token(), prm.tes)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_autotemplates", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async getdistrict(context, prm) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getdistrict(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_districts", resp.data.records)
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
},
async getkelurahan(context, prm) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getkelurahan(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_kelurahans", resp.data.records)
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
}
}
}

View File

@@ -0,0 +1,482 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/subcategory.js"
export default {
namespaced: true,
state: {
subcategorys: [],
save_status: 0,
save_error_message: '',
dialog_form_subcategory: false,
dialog_status_order: false,
lookup_subcategory: 0,
search_status: 0,
errors: [],
startdate: moment(new Date()).format('YYYY-MM-DD'),
enddate: moment(new Date()).format('YYYY-MM-DD'),
bases: [],
base: {},
omzettypes: [],
omzettype: {},
subcategorytypes: [],
subcategorytype: {},
agingtypes: [],
agingtype: {},
statuss: [],
autocategorys:[],
autocategory:{},
autocitys:[],
autocity:{},
autodistricts:[],
autodistrict:{},
autokelurahans:[],
autokelurahan:{},
autocompanys:[],
autocompany:{},
automous:[],
automou:{},
autodoctors:[],
autodoctor:{},
addressdoctors:[],
addressdoctor:{},
current_page:1,
x_search: '',
total_data: 0,
selected_subcategory: {
name: ""
},
get_data_status: 0,
get_data_error_message: ''
},
mutations: {
update_selected_subcategory(state, val) {
state.selected_subcategory = val
},
update_x_search(state, val) {
state.x_search = val
},
update_current_page(state, val) {
state.current_page = val
},
update_total_data(state, val) {
state.total_data = val
},
update_autocategorys(state,data){
state.autocategorys = data
},
update_autocategory(state,val){
state.autocategory = val
},
update_autocitys(state,data){
state.autocitys = data
},
update_autocity(state,val){
state.autocity = val
},
update_autocompanys(state,data){
state.autocompanys = data
},
update_autocompany(state,val){
state.autocompany = val
},
update_automous(state,data){
state.automous = data
},
update_automou(state,val){
state.automou = val
},
update_autodoctors(state,data){
state.autodoctors = data
},
update_autodoctor(state,val){
state.autodoctor = val
},
update_addressdoctors(state,data){
state.addressdoctors = data
},
update_addressdoctor(state,val){
state.addressdoctor = val
},
update_autodistricts(state,data){
state.autodistricts = data
},
update_autodistrict(state,val){
state.autodistrict = val
},
update_autokelurahans(state,data){
state.autokelurahans = data
},
update_autokelurahan(state,val){
state.autokelurahan = val
},
update_errors(state, val) {
state.errors = val
},
update_subcategorys(state, data) {
state.subcategorys = data
},
update_save_status(state, val) {
state.save_status = val
},
update_save_error_message(state, val) {
state.save_error_message = val
},
update_dialog_form_subcategory(state, val) {
state.dialog_form_subcategory = val
},
update_lookup_subcategory(state, val) {
state.lookup_subcategory = val
},
update_startdate(state, val) {
state.startdate = val
},
update_enddate(state, val) {
state.enddate = val
},
update_bases(state, data) {
state.bases = data
},
update_base(state, val) {
state.base = val
},
update_omzettypes(state, data) {
state.omzettypes = data
},
update_omzettype(state, val) {
state.omzettype = val
},
update_subcategorytypes(state, data) {
state.subcategorytypes = data
},
update_subcategorytype(state, val) {
state.subcategorytype = val
},
update_agingtypes(state, data) {
state.agingtypes = data
},
update_agingtype(state, val) {
state.agingtype = val
},
update_search_status(state, val) {
state.search_status = val
},
update_statuss(state, data) {
state.statuss = data
},
update_dialog_status_order(state, val) {
state.dialog_status_order = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_get_data_error_message(state, val) {
state.get_data_error_message = val
}
},
actions: {
async save(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
var data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("category/update_alert_success", true, {
root: true
})
context.commit("update_dialog_form_subcategory", false)
var msg = "Sub Kategori " + prm.name + " Kategori " + prm.categoryname + " sudah disimpan dong"
context.commit("category/update_msg_success", msg, {
root: true
})
context.commit("category/update_alert_success", true, {
root: true
})
context.dispatch("lookupbyname", {
category: prm.categoryname,
subcategory: prm.ssubcategory,
current_page: 1,
lastid: -1
})
} else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async lookupx(context, prm) {
context.commit("update_lookup_subcategory", 1)
try {
let resp = await api.lookupx(one_token(), prm.id)
if (resp.status != "OK") {
context.commit("update_lookup_subcategory", 3)
} else {
context.commit("update_lookup_subcategory", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_subcategorys", data.records)
}
} catch (e) {
context.commit("update_lookup_subcategory", 3)
}
},
async lookup(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.lookup(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_subcategorys", data.records)
console.log('status')
console.log(data.records.statuss)
context.commit("update_statuss", data.records.statuss)
context.commit("update_total_data", data.total)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async lookupbyname(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.lookupbyname(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_subcategorys", data.records)
console.log(data.records)
context.commit("update_total_data", data.total)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async delete(context, prm) {
context.commit("update_save_status", 1)
try {
let resp = await api.xdelete(one_token(), prm.xid)
if (resp.status != "OK") {
context.commit("category/update_save_status", 3, {
root: true
})
context.commit("category/update_save_error_message", resp.message, {
root: true
})
} else {
context.commit("category/update_save_status", 2, {
root: true
})
context.commit("category/update_save_error_message", resp.message, {
root: true
})
context.commit("category/update_alert_success", true, {
root: true
})
//context.commit("update_dialog_form_schedule_promise", false)
var msg = "Sub Kategori sudah dihapus dong"
context.commit("category/update_msg_success", msg, {
root: true
})
context.commit("category/update_alert_success", true, {
root: true
})
context.dispatch("lookupbyname", {
category: prm.scategory,
subcategory: prm.ssubcategory,
current_page: 1,
lastid: -1
})
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async searchcategory(context,prm) {
context.commit("category/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchcategory(prm)
if (resp.status != "OK") {
context.commit("category/update_autocomplete_status",3,{root: true})
} else {
context.commit("category/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autocategorys",resp.data.records)
}
} catch(e) {
context.commit("category/update_autocomplete_status",3,{root: true})
}
},
async searchcity(context,prm) {
context.commit("category/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchcity(prm)
if (resp.status != "OK") {
context.commit("category/update_autocomplete_status",3,{root: true})
} else {
context.commit("category/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autocitys",resp.data.records)
}
} catch(e) {
context.commit("category/update_autocomplete_status",3,{root: true})
}
},
async searchdistrict(context,prm) {
context.commit("category/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchdistrict(prm)
if (resp.status != "OK") {
context.commit("category/update_autocomplete_status",3,{root: true})
} else {
context.commit("category/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autodistricts",resp.data.records)
}
} catch(e) {
context.commit("category/update_autocomplete_status",3,{root: true})
}
},
async searchkelurahan(context,prm) {
context.commit("category/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchkelurahan(prm)
if (resp.status != "OK") {
context.commit("category/update_autocomplete_status",3,{root: true})
} else {
context.commit("category/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autokelurahans",resp.data.records)
}
} catch(e) {
context.commit("category/update_autocomplete_status",3,{root: true})
}
},
async searchcompany(context,prm) {
context.commit("category/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchcompany(prm)
if (resp.status != "OK") {
context.commit("category/update_autocomplete_status",3,{root: true})
} else {
context.commit("category/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autocompanys",resp.data.records)
}
} catch(e) {
context.commit("category/update_autocomplete_status",3,{root: true})
}
},
async searchmou(context,prm) {
context.commit("category/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchmou(prm)
if (resp.status != "OK") {
context.commit("category/update_autocomplete_status",3,{root: true})
} else {
context.commit("category/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_automous",resp.data.records)
}
} catch(e) {
context.commit("category/update_autocomplete_status",3,{root: true})
}
},
async searchdoctor(context,prm) {
context.commit("category/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchdoctor(prm)
if (resp.status != "OK") {
context.commit("category/update_autocomplete_status",3,{root: true})
} else {
context.commit("category/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autodoctors",resp.data.records)
}
} catch(e) {
context.commit("category/update_autocomplete_status",3,{root: true})
}
},
async selectaddressdoctor(context,prm) {
context.commit("update_get_data_status", 1)
try {
prm.token = one_token()
let resp = await api.selectaddressdoctor(prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_addressdoctors", resp.data.records.addressdoctors)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
}
}
}

View File

@@ -0,0 +1,25 @@
// State
// data ...
// Mutations
//
//
// Actions
import category from "./modules/category.js";
import subcategory from "./modules/subcategory.js";
import system from "../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
category: category,
subcategory: subcategory,
system:system
},
state: {
},
mutations: {
},
actions: {
}
});

View File

@@ -0,0 +1,203 @@
const URL = "/one-api/v1/regonline/";
export async function save(prm) {
try {
var resp = await axios.post(URL + 'description/addnewattribute', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(token,id) {
try {
var resp = await axios.post(URL + 'description/deleteattribute', { id: id ,token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchtest(prm) {
try {
var resp = await axios.post(URL + 'description/searchtest',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 searchsubcategory(prm) {
try {
var resp = await axios.post(URL + 'description/searchsubcategory',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 searchdistrict(prm) {
try {
var resp = await axios.post(URL + 'description/searchdistrict',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 searchkelurahan(prm) {
try {
var resp = await axios.post(URL + 'description/searchkelurahan',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcompany(prm) {
try {
var resp = await axios.post(URL + 'description/searchcompany',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchmou(prm) {
try {
var resp = await axios.post(URL + 'description/searchmou',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchdoctor(prm) {
try {
var resp = await axios.post(URL + 'description/searchdoctor',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function lookupbyname(prm) {
try {
var resp = await axios.post(URL + 'description/lookupattributebyname', 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 selectaddressdoctor(prm) {
try {
var resp = await axios.post(URL + 'description/selectaddressdoctor',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
};
}
}

View File

@@ -0,0 +1,279 @@
const URL = "/one-api/mockup/masterdata/";
export async function lookup(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookup', 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 lookupbybranch(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbybranch', 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 lookupbydistrict(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbydistrict', 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 lookupbykelurahan(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbykelurahan', 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 lookupbyname(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbyname', 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 + 'branchv2/addnewregional', 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 update(prm) {
try {
var resp = await axios.post(URL + 'branchv2/editregional', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(token,id) {
try {
var resp = await axios.post(URL + 'branchv2/deleteregional', { id: id, token:token });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function selectnonlab(token) {
try {
var resp = await axios.post(URL + 'branchv2/selectnonlab',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchbranch(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/searchbranch',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchdoctor(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/searchdoctor',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchinstrument(token,tes) {
try {
var resp = await axios.post(URL + 'branchv2/searchinstrument',{token:token,search:tes});
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 searchtemplate(token,tes) {
try {
var resp = await axios.post(URL + 'branchv2/searchtemplate',{token:token,search:tes});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdistrict(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/getdistrict',{id:prm.M_BranchID,token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getkelurahan(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/getkelurahan',{token:token,id:prm.M_DistrictID});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,852 @@
<template>
<v-layout>
<v-flex xs12>
<v-card class="mb-2" color="white">
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>DESKRIPSI PEMERIKSAAN</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormBranch(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
<v-list-tile>
<input type="text" v-model="xsearch" class="textinput" label="Nama Station" placeholder="Cari ..." />
</v-list-tile-content>
</v-list-tile>
</v-layout>
<v-divider></v-divider>
<v-layout row wrap class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="branchs" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.Nat_TestCode">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.testname">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.Nat_TestShortNameBarcode">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.NatOlDescriptionNote">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-icon small class="ml-3" color="primary" @click="editFormBranch(props.item)">edit</v-icon>
<v-icon small class="ml-3" color="error" @click="deleteFormBranch(props.item)">clear</v-icon>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
<template>
<v-layout row justify-center>
<v-dialog v-model="dialogbranch" persistent max-width="750px">
<v-card>
<v-card-title>
<span class="headline">FORM ATRIBUT PEMERIKSAAN</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formregionalbranch" v-model="validbranch" lazy-validation>
<v-layout wrap>
<v-flex xs12 v-if="this.xid == '0'">
<v-autocomplete label="Pemeriksaan*" v-model="xautotest" :items="xautotests" :search-input.sync="search_test" auto-select-first
no-filter item-text="Nat_TestName" return-object no-data-text="Cari Pemeriksaan"
small :rules="regionalRules" required>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.Nat_TestName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex xs12 v-if="this.xid != '0'">
<v-autocomplete label="Pemeriksaan*" readonly v-model="xautotest" :items="xautotests" auto-select-first
no-filter item-text="Nat_TestName" return-object no-data-text="Cari Pemeriksaan"
small :rules="regionalRules" required>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.Nat_TestName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex xs12>
<v-textarea :rules="descRules" required v-model="xdescattribute" label="Deskripsi*"></v-textarea>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormBranch()">Tutup</v-btn>
<v-btn color="blue darken-1" flat @click="saveFormBranch()">Simpan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</v-layout>
</template>
</v-card>
</v-flex>
<one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprint" :urlprint="urlprint" @close-dialog-print="closePrint"></one-dialog-print>
<template>
<v-dialog v-model="dialogdeletealertbranch" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalertbranch}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealertbranch = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlertBranch()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.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;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
components: {
'one-date-picker': httpVueLoader('../../../common/oneDatePicker.vue'),
'one-dialog-print': httpVueLoader('../../../common/oneDialogPrintX.vue')
},
data() {
return {
query: "",
items: [],
openprint: false,
urlprint: '',
printtitle: '',
printwidth: 600,
formatreport: 'pdf',
readonlydefault: false,
page: 1,
xname: '',
xphone: '',
xcode: '',
xaddress: '',
xipaddress: '',
xbasename: '',
xshortattribute: '',
xdescattribute: '',
isdefault: false,
issatellite: false,
search_test: '',
search_subcategory: '',
search_district: '',
search_kelurahan: '',
search_company: '',
search_mou: '',
search_doctor: '',
shortRules: [
v => !!v || 'Atribut Singkat harus diisi'
],
descRules: [
v => !!v || 'Deskripsi harus diisi'
],
addressRules: [
v => !!v || 'Alamat harus diisi'
],
xipaddressRules: [
v => !!v || 'Alamat IP harus diisi'
],
regionalRules: [
v => !!v || 'Regional harus dipilih'
],
subcategoryRules: [
v => !!v || 'Kategori harus dipilih'
],
districtRules: [
v => !!v || 'Kecamatan harus dipilih'
],
kelurahanRules: [
v => !!v || 'Kelurahan harus dipilih'
],
headers: [{
text: "KODE",
align: "left",
sortable: false,
value: "lab",
width: "5%",
class: "blue lighten-3 white--text"
},
{
text: "PEMERIKSAAN",
align: "left",
sortable: false,
value: "name",
width: "15%",
class: "blue lighten-3 white--text"
},
{
text: "PEMERIKSAAN (SINGKAT)",
align: "left",
sortable: false,
value: "name",
width: "15%",
class: "blue lighten-3 white--text"
},
{
text: "DESKRIPSI",
align: "left",
sortable: false,
value: "name",
width: "40%",
class: "blue lighten-3 white--text"
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "status",
width: "10%",
class: "blue lighten-3 white--text"
}
],
pagination: {
descending: false,
page: 1,
rowsPerPage: 100,
sortBy: 'M_BranchName ASC',
totalItems: this.$store.state.branch.total_transactions
},
statuss: [{
waktu: '16-07-2019 10:00',
status: 'Order Dibuat',
branch: 'Nagita Slavina'
},
{
waktu: '16-07-2019 11:00',
status: 'Order Dikirim',
branch: 'Nagita Slavina'
},
{
waktu: '16-07-2019 12:00',
status: 'Order dikonfirmasi',
branch: 'Chacha Frederica'
},
{
waktu: '16-07-2019 13:00',
status: 'Telah dibuat Surat Jalan',
branch: 'Chacha Frederica'
},
{
waktu: '16-07-2019 14:00',
status: 'Kurir akan mengambil sampel',
branch: 'Satria Subiantoro'
}
],
color: "success",
validbranch: false,
xid: 0,
isinput: "N",
countprice: 0,
branchbranchid: 0,
branchxname: "",
branchlang: "",
branchtext: "",
isadvance: "N",
branchformatadvance: "",
issenttoregional: "N",
menustartdate: false,
menuenddate: false,
date: new Date().toISOString().substr(0, 10),
dialogdeletealertbranch: false,
dialogverifyalertbranch: false,
dialogreleasealertbranch: false,
alertverify: false,
dialogunreleasealertbranch: false,
dialogunverifyalertbranch: false,
msgalertbranch: ""
};
},
mounted() {
this.$store.dispatch("branch/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
},
computed: {
branchs() {
return this.$store.state.branch.branchs
},
xregional() {
return this.$store.state.regional.selected_regional
},
dialogbranch() {
return this.$store.state.branch.dialog_form_branch
},
xerrors() {
return this.$store.state.branch.errors
},
isLoading() {
return this.$store.state.branch.search_status == 1
},
startComputedDateFormatted() {
return this.formatDate(this.xstartdate)
},
xstartdate: {
get() {
return this.$store.state.branch.startdate
},
set(val) {
this.$store.commit("branch/update_startdate", val)
}
},
endComputedDateFormatted() {
return this.formatDate(this.xenddate)
},
xenddate: {
get() {
return this.$store.state.branch.enddate
},
set(val) {
this.$store.commit("branch/update_enddate", val)
}
},
xautosubcategorys() {
return this.$store.state.branch.autosubcategorys
},
xautosubcategory: {
get() {
return this.$store.state.branch.autosubcategory
},
set(val) {
this.$store.commit("branch/update_autosubcategory", val)
this.$store.dispatch("branch/searchdistrict", {
search: this.search_district,
id: val.T_SubCategoryID
})
}
},
xautodistricts() {
return this.$store.state.branch.autodistricts
},
xautodistrict: {
get() {
return this.$store.state.branch.autodistrict
},
set(val) {
this.$store.commit("branch/update_autodistrict", val)
this.$store.dispatch("branch/searchkelurahan", {
search: this.search_kelurahan,
id: val.M_DistrictID
})
}
},
xautokelurahans() {
return this.$store.state.branch.autokelurahans
},
xautokelurahan: {
get() {
return this.$store.state.branch.autokelurahan
},
set(val) {
this.$store.commit("branch/update_autokelurahan", val)
}
},
xautocompanys() {
return this.$store.state.branch.autocompanys
},
xautocompany: {
get() {
return this.$store.state.branch.autocompany
},
set(val) {
this.$store.commit("branch/update_autocompany", val)
this.$store.dispatch("branch/searchmou", {
search: this.search_mou,
id: val.M_CompanyID
})
}
},
xautomous() {
return this.$store.state.branch.automous
},
xautomou: {
get() {
return this.$store.state.branch.automou
},
set(val) {
this.$store.commit("branch/update_automou", val)
}
},
xautodoctors() {
return this.$store.state.branch.autodoctors
},
xautodoctor: {
get() {
return this.$store.state.branch.autodoctor
},
set(val) {
this.$store.commit("branch/update_autodoctor", val)
this.$store.dispatch("branch/selectaddressdoctor", {
id: val.M_DoctorID
})
}
},
xaddressdoctors() {
return this.$store.state.branch.addressdoctors
},
xaddressdoctor: {
get() {
return this.$store.state.branch.addressdoctor
},
set(val) {
this.$store.commit("branch/update_addressdoctor", val)
}
},
xstatuss() {
return this.$store.state.branch.statuss
},
dialogstatusorder() {
return this.$store.state.branch.dialog_status_order
},
xautotests() {
return this.$store.state.branch.autotests
},
xautotest: {
get() {
return this.$store.state.branch.autotest
},
set(val) {
this.$store.commit("branch/update_autotest", val)
}
},
xsearch: {
get() {
return this.$store.state.branch.x_search
},
set(val) {
this.$store.commit("branch/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.branch.current_page
},
set(val) {
this.$store.commit("branch/update_current_page", val)
this.$store.dispatch("branch/lookupbyname", {
regional: this.$store.state.regional.x_search,
branch: this.xsearch,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.branch.total_data
},
set(val) {
this.$store.commit("branch/update_total_data", val)
}
}
},
methods: {
isSelected(p) {
return p.id == this.$store.state.branch.selected_branch.id
},
selectMe(sc) {
this.$store.commit("branch/update_selected_branch", sc)
},
updateDialogFormBranch() {
this.$store.commit("branch/update_dialog_form_branch", false)
},
updateDialogStatusOrder() {
this.$store.commit("branch/update_dialog_status_order", false)
},
setStatusOrder(val) {
this.$store.commit("branch/update_branchs", {})
this.$store.commit("branch/update_dialog_status_order", true)
this.$store.commit("branch/update_statuss", val.statuss)
},
doPriceList(val) {
console.log(location)
var id = val.id
location.replace("/one-ui/regional/vuex/one-md-price/" + "?id=" + id)
},
doPrice() {
console.log(location)
var id = this.xid
location.replace("/one-ui/regional/vuex/one-md-price/" + "?id=" + id)
},
thr_search_test: _.debounce(function () {
this.$store.dispatch("branch/searchtest", {
tes: this.search_test
})
}, 200),
thr_search_subcategory: _.debounce(function () {
this.$store.dispatch("branch/searchsubcategory", {
search: this.search_subcategory
})
}, 200),
thr_search_district: _.debounce(function () {
this.$store.dispatch("branch/searchdistrict", {
search: this.search_district,
id: this.xautosubcategory.T_SubCategoryID
})
}, 200),
thr_search_kelurahan: _.debounce(function () {
this.$store.dispatch("branch/searchkelurahan", {
search: this.search_kelurahan,
id: this.xautodistrict.M_DistrictID
})
}, 200),
thr_search: _.debounce(function () {
this.$store.dispatch("regional/lookupbyname", {
regional: this.$store.state.regional.x_search,
branch: this.xsearch,
current_page: 1,
lastid: -1
})
this.$store.dispatch("branch/lookupbyname", {
regional: this.$store.state.regional.x_search,
branch: this.xsearch,
current_page: 1,
lastid: -1
})
}, 200),
thr_search_company: _.debounce(function () {
this.$store.dispatch("branch/searchcompany", {
search: this.search_company
})
}, 200),
thr_search_mou: _.debounce(function () {
this.$store.dispatch("branch/searchmou", {
search: this.search_mou,
id: this.xautocompany.M_CompanyID
})
}, 200),
thr_search_doctor: _.debounce(function () {
this.$store.dispatch("branch/searchdoctor", {
search: this.search_doctor
})
}, 200),
searchRegional() {
this.$store.dispatch("branch/lookup", {
id: this.xregional.name === "" ? "0" : this.$store.state.regional.selected_regional
.id,
search: this.xsearch,
current_page: 1,
lastid: -1
})
},
doPrint() {
console.log('doprint')
this.printwidth = 1028
this.printtitle = ""
let branch = one_branch()
var id = this.xid
var d = new Date();
var n = d.getTime()
var rptname = 'regional_price'
var formatrpt = this.formatreport
this.urlprint = "/birt/run?__report=report/one/md/" + rptname +
".rptdesign&__format=" +
formatrpt + "&PBranchID=" + id + "&branchxname=" + branch.M_BranchBranchname +
"&tm=" + n
this.openprint = true
},
closePrint() {
this.openprint = false
},
openFormBranch(val) {
this.xid = val
this.xshortattribute = ''
this.xdescattribute = ''
this.$store.commit("branch/update_autotests", [])
this.$store.commit("branch/update_autotest", {})
this.$store.commit("branch/update_dialog_form_branch", true)
},
editFormBranch(val) {
this.xid = val.id
this.xdescattribute = val.NatOlDescriptionNote
this.$store.commit("branch/update_autotests", [{
Nat_TestID: val.Nat_TestID,
Nat_TestName: val.Nat_TestName
}])
this.$store.commit("branch/update_autotest", {
Nat_TestID: val.Nat_TestID,
Nat_TestName: val.Nat_TestName
})
this.$store.commit("branch/update_dialog_form_branch", true)
},
checkError(value) {
var errors = this.$store.state.branch.errors
if (errors.includes(value)) {
return true
} else {
return false
}
},
saveFormBranch() {
if (this.$refs.formregionalbranch.validate()) {
this.$store.dispatch("branch/save", {
xid: this.xid,
testid: this.xautotest ? this.$store.state.branch.autotest.Nat_TestID :
0,
testname: this.$store.state.branch.autotest.Nat_TestName,
note: this.xdescattribute,
sbranch: this.xsearch
})
}
},
set_date2(x) {
this.startdate = x.new_date
},
set_date3(x) {
this.enddate = x.new_date
},
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')}`
},
updateAlert_success(val) {
this.$store.commit("regional/update_alert_success", val)
},
deleteFormBranch(data) {
this.xid = data.id
this.msgalertbranch = "Yakin, mau hapus deskripsi ini?"
this.dialogdeletealertbranch = true
},
closeDeleteAlertBranch() {
this.$store.dispatch("branch/delete", {
xid: this.xid,
regionalid: this.$store.state.branch.autotest.Nat_TestID,
regionalname: this.$store.state.branch.autotest.Nat_TestName,
name: this.xname,
sregional: this.$store.state.regional.x_search,
sbranch: this.xsearch
})
this.dialogdeletealertbranch = false
}
},
watch: {
xsearch(val, old) {
console.log(val)
this.xsearch = val
this.thr_search()
},
search_test(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_test()
},
search_subcategory(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_subcategory()
},
search_district(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_district()
},
search_kelurahan(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_kelurahan()
},
search_company(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_company()
},
search_mou(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_mou()
},
search_doctor(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_doctor()
}
}
}
</script>

View File

@@ -0,0 +1,620 @@
<template>
<v-layout>
<template>
<v-dialog v-model="dialogdeletealert" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalert}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealert = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlert()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogregional" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">FORM REGIONAL</span></v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formregional" v-model="valid" lazy-validation>
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="xname" label="Nama*" :rules="xnameRules" required></v-text-field>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormRegional()">Tutup</v-btn>
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormRegional()">Simpan</v-btn>
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormRegional()">Simpan Perubahan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</template>
<v-flex xs12>
<v-card>
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>REGIONAL</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormRegional(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-snackbar v-model="snackbar" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
{{msgsnackbar}}
<v-btn flat @click="updateAlert_success(false)">
Tutup
</v-btn>
</v-snackbar>
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
<v-list-tile>
<input type="text" v-model="xsearch" class="textinput" label="Nama Station" placeholder="Cari ..." />
</v-list-tile-content>
</v-list-tile>
</v-layout>
<v-divider></v-divider>
<div>
<v-layout row class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="vregionals" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.namex}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-icon small class="ml-3" color="primary" @click="editRegional(props.item)">edit</v-icon>
<v-icon small class="ml-3" color="error" @click="deleteRegional(props.item)">clear</v-icon>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
</div>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.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;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
data() {
return {
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
dialogdeletealert: false,
msgalert: "",
valid: false,
xid: 0,
search_instrument: '',
items: [],
xname: '',
xcode: '',
xnameRules: [
v => !!v || 'Nama harus diisi'
],
instrumentRules: [
v => !!v || 'Instrument harus dipilih'
],
name: '',
isdefault: false,
scode: '',
search_doctor: '',
search_testheader: '',
search_template: '',
page: 1,
headers: [{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
pagination: {
descending: true,
page: 1,
rowsPerPage: 100,
sortBy: 'id DESC',
totalItems: this.$store.state.regional.total_filter_regionals
}
};
},
mounted() {
this.$store.dispatch("branch/selectaddressdoctor", {
id: 0
})
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
this.$store.dispatch("branch/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
},
computed: {
xact() {
return this.$store.state.regional.act
},
xerrors() {
return this.$store.state.regional.errors
},
xshowall() {
return this.$store.state.regional.show_all
},
vregionals() {
return this.$store.state.regional.regionals
},
xtotalregionals() {
return this.$store.state.regional.total_regionals
},
xtotalfilterregionals() {
return this.$store.state.regional.total_filter_regionals
},
xsearch: {
get() {
return this.$store.state.regional.x_search
},
set(val) {
this.$store.commit("regional/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.regional.current_page
},
set(val) {
this.$store.commit("regional/update_current_page", val)
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.regional.total_regionals
},
set(val) {
this.$store.commit("regional/update_total_regionals", val)
}
},
dialogregional() {
return this.$store.state.regional.dialog_form_regional
},
snackbar: {
get() {
return this.$store.state.regional.alert_success
},
set(val) {
this.$store.commit("regional/update_alert_success", val)
}
},
msgsnackbar() {
return this.$store.state.regional.msg_success
},
lookupstatus() {
return this.$store.state.regional.lookup_regional
},
xregionaltypes() {
return this.$store.state.regional.regionaltypes
},
xregionaltype: {
get() {
return this.$store.state.regional.regionaltype
},
set(val) {
this.$store.commit("regional/update_regionaltype", val)
}
},
isLoading() {
return this.$store.state.regional.search_status == 1
},
xnonlabs() {
return this.$store.state.regional.nonlabs
},
xnonlab: {
get() {
return this.$store.state.regional.selected_nonlab
},
set(val) {
this.$store.commit("regional/update_selected_nonlab", val)
}
},
xcities() {
return this.$store.state.regional.cities
},
branchaddress: {
get() {
return this.$store.state.regional.branch_address
},
set(val) {
this.$store.commit("regional/update_branch_address", val)
this.$store.dispatch("regional/getdistrict", this.$store.state.regional.branch_address)
}
},
xdoctors() {
return this.$store.state.regional.doctors
},
doctor: {
get() {
return this.$store.state.regional.doctor
},
set(val) {
this.$store.commit("regional/update_doctor", val)
}
},
xinstruments() {
return this.$store.state.regional.instruments
},
xinstrument: {
get() {
return this.$store.state.regional.instrument
},
set(val) {
this.$store.commit("regional/update_instrument", val)
}
},
xautotemplates() {
return this.$store.state.regional.autotemplates
},
xautotemplate: {
get() {
return this.$store.state.regional.autotemplate
},
set(val) {
this.$store.commit("regional/update_autotemplate", val)
}
},
xdistricts() {
return this.$store.state.regional.districts
},
districtaddress: {
get() {
return this.$store.state.regional.district_address
},
set(val) {
this.$store.commit("regional/update_district_address", val)
this.$store.dispatch("regional/getkelurahan", this.$store.state.regional.district_address)
}
},
xkelurahans() {
return this.$store.state.regional.kelurahans
},
kelurahanaddress: {
get() {
return this.$store.state.regional.kelurahan_address
},
set(val) {
this.$store.commit("regional/update_kelurahan_address", val)
}
}
},
methods: {
updateShowAll(val) {
this.$store.commit("regional/update_show_all", val)
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: this.curr_page,
lastid: -1
})
},
searchRegional() {
this.$store.dispatch("regional/lookup", {
search: this.xsearch,
current_page: 1,
lastid: -1
})
},
isSelected(p) {
return p.id == this.$store.state.regional.selected_regional.id
},
subname(name) {
var xname = name
if (xname.length > 18) {
xname = xname.substring(0, 18) + '...'
}
return xname
},
selectMe(sc) {
this.$store.commit("regional/update_selected_regional", sc)
this.$store.dispatch("branch/lookupbyname", {
regional: this.$store.state.regional.selected_regional.name,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
this.$store.commit("branch/update_autoregionals", [{
S_RegionalID: this.$store.state.regional.selected_regional.id,
S_RegionalName: this.$store.state.regional.selected_regional.name
}])
this.$store.commit("branch/update_autoregional", {
S_RegionalID: this.$store.state.regional.selected_regional.id,
S_RegionalName: this.$store.state.regional.selected_regional.name
})
},
updateDialogFormRegional() {
this.$store.commit("regional/update_dialog_form_regional", false)
},
openFormRegional() {
this.xcode = ""
this.xname = ""
this.isdefault = "N"
this.$refs.formregional.reset()
this.$refs.formregional.resetValidation()
this.$store.commit("regional/update_act", 'new')
this.$store.commit("regional/update_dialog_form_regional", true)
},
thr_search_instrument: _.debounce(function () {
this.$store.dispatch("regional/searchinstrument", {
tes: this.search_instrument
})
}, 2000),
saveFormRegional() {
if (this.$refs.formregional.validate()) {
this.$store.dispatch("regional/save", {
name: this.xname,
sregional: this.xsearch,
sbranch: this.$store.state.branch.x_search
})
}
},
updateFormRegional() {
if (this.$refs.formregional.validate()) {
this.$store.dispatch("regional/update", {
id: this.xid,
name: this.xname,
sregional: this.xsearch,
sbranch: this.$store.state.branch.x_search
})
}
},
updateAlert_success(val) {
this.$store.commit("regional/update_alert_success", val)
},
editRegional(data) {
this.xid = data.id
this.xcode = data.code
this.xname = data.name
this.isdefault = data.S_RegionalIsDefault === 'N' ? false : true
this.$store.commit("regional/update_act", 'edit')
this.$store.commit("regional/update_dialog_form_regional", true)
},
deleteRegional(data) {
this.xid = data.id
var xdata = {
id: data.id,
name: data.name,
branchs: 'xxx'
}
this.$store.commit("regional/update_selected_regional", xdata)
this.msgalert = "Yakin, mau hapus regional " + data.name + " ?"
this.dialogdeletealert = true
},
changeNewRegionalType(value) {
this.readonlytyperegional = value === true ? true : false
this.readonlytyperegionalnew = value === true ? false : true
},
newRegionalType() {
readonlytyperegional: true
readonlytyperegionalnew: false
},
closeDeleteAlert() {
this.$store.dispatch("regional/delete", {
regionalid: this.$store.state.regional.selected_regional.id,
xname: this.$store.state.regional.selected_regional.name,
sregional: this.xsearch,
sbranch: this.$store.state.branch.x_search
})
this.dialogdeletealert = false
},
thr_search: _.debounce(function () {
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
this.$store.dispatch("branch/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
}, 1000)
},
watch: {
xsearch(val, old) {
console.log(val)
this.xsearch = val
this.thr_search()
},
search_instrument(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.regional.update_autocomplete_status == 1) return
this.thr_search_instrument()
}
}
}
</script>

View File

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

View File

@@ -0,0 +1,482 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/branch.js"
export default {
namespaced: true,
state: {
branchs: [],
save_status: 0,
save_error_message: '',
dialog_form_branch: false,
dialog_status_order: false,
lookup_branch: 0,
search_status: 0,
errors: [],
startdate: moment(new Date()).format('YYYY-MM-DD'),
enddate: moment(new Date()).format('YYYY-MM-DD'),
bases: [],
base: {},
omzettypes: [],
omzettype: {},
branchtypes: [],
branchtype: {},
agingtypes: [],
agingtype: {},
statuss: [],
autotests:[],
autotest:{},
autosubcategorys:[],
autosubcategory:{},
autodistricts:[],
autodistrict:{},
autokelurahans:[],
autokelurahan:{},
autocompanys:[],
autocompany:{},
automous:[],
automou:{},
autodoctors:[],
autodoctor:{},
addressdoctors:[],
addressdoctor:{},
current_page:1,
x_search: '',
total_data: 0,
selected_branch: {
name: ""
},
get_data_status: 0,
get_data_error_message: ''
},
mutations: {
update_selected_branch(state, val) {
state.selected_branch = val
},
update_x_search(state, val) {
state.x_search = val
},
update_current_page(state, val) {
state.current_page = val
},
update_total_data(state, val) {
state.total_data = val
},
update_autotests(state,data){
state.autotests = data
},
update_autotest(state,val){
state.autotest = val
},
update_autosubcategorys(state,data){
state.autosubcategorys = data
},
update_autosubcategory(state,val){
state.autosubcategory = val
},
update_autocompanys(state,data){
state.autocompanys = data
},
update_autocompany(state,val){
state.autocompany = val
},
update_automous(state,data){
state.automous = data
},
update_automou(state,val){
state.automou = val
},
update_autodoctors(state,data){
state.autodoctors = data
},
update_autodoctor(state,val){
state.autodoctor = val
},
update_addressdoctors(state,data){
state.addressdoctors = data
},
update_addressdoctor(state,val){
state.addressdoctor = val
},
update_autodistricts(state,data){
state.autodistricts = data
},
update_autodistrict(state,val){
state.autodistrict = val
},
update_autokelurahans(state,data){
state.autokelurahans = data
},
update_autokelurahan(state,val){
state.autokelurahan = val
},
update_errors(state, val) {
state.errors = val
},
update_branchs(state, data) {
state.branchs = data
},
update_save_status(state, val) {
state.save_status = val
},
update_save_error_message(state, val) {
state.save_error_message = val
},
update_dialog_form_branch(state, val) {
state.dialog_form_branch = val
},
update_lookup_branch(state, val) {
state.lookup_branch = val
},
update_startdate(state, val) {
state.startdate = val
},
update_enddate(state, val) {
state.enddate = val
},
update_bases(state, data) {
state.bases = data
},
update_base(state, val) {
state.base = val
},
update_omzettypes(state, data) {
state.omzettypes = data
},
update_omzettype(state, val) {
state.omzettype = val
},
update_branchtypes(state, data) {
state.branchtypes = data
},
update_branchtype(state, val) {
state.branchtype = val
},
update_agingtypes(state, data) {
state.agingtypes = data
},
update_agingtype(state, val) {
state.agingtype = val
},
update_search_status(state, val) {
state.search_status = val
},
update_statuss(state, data) {
state.statuss = data
},
update_dialog_status_order(state, val) {
state.dialog_status_order = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_get_data_error_message(state, val) {
state.get_data_error_message = val
}
},
actions: {
async save(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
var data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("regional/update_alert_success", true, {
root: true
})
context.commit("update_dialog_form_branch", false)
var msg = "Cabang " + prm.name + " Regional " + prm.regionalname + " sudah disimpan dong"
context.commit("regional/update_msg_success", msg, {
root: true
})
context.commit("regional/update_alert_success", true, {
root: true
})
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
current_page: 1,
lastid: -1
})
} else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async lookupx(context, prm) {
context.commit("update_lookup_branch", 1)
try {
let resp = await api.lookupx(one_token(), prm.id)
if (resp.status != "OK") {
context.commit("update_lookup_branch", 3)
} else {
context.commit("update_lookup_branch", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_branchs", data.records)
}
} catch (e) {
context.commit("update_lookup_branch", 3)
}
},
async lookup(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.lookup(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_branchs", data.records)
console.log('status')
console.log(data.records.statuss)
context.commit("update_statuss", data.records.statuss)
context.commit("update_total_data", data.total)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async lookupbyname(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.lookupbyname(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_branchs", data.records)
console.log(data.records)
context.commit("update_total_data", data.total)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async delete(context, prm) {
context.commit("update_save_status", 1)
try {
let resp = await api.xdelete(one_token(), prm.xid)
if (resp.status != "OK") {
context.commit("regional/update_save_status", 3, {
root: true
})
context.commit("regional/update_save_error_message", resp.message, {
root: true
})
} else {
context.commit("regional/update_save_status", 2, {
root: true
})
context.commit("regional/update_save_error_message", resp.message, {
root: true
})
context.commit("regional/update_alert_success", true, {
root: true
})
//context.commit("update_dialog_form_schedule_promise", false)
var msg = "Cabang sudah dihapus dong"
context.commit("regional/update_msg_success", msg, {
root: true
})
context.commit("regional/update_alert_success", true, {
root: true
})
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
current_page: 1,
lastid: -1
})
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async searchtest(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchtest(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autotests",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchsubcategory(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchsubcategory(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autosubcategorys",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchdistrict(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchdistrict(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autodistricts",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchkelurahan(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchkelurahan(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autokelurahans",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchcompany(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchcompany(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autocompanys",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchmou(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchmou(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_automous",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchdoctor(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchdoctor(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autodoctors",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async selectaddressdoctor(context,prm) {
context.commit("update_get_data_status", 1)
try {
prm.token = one_token()
let resp = await api.selectaddressdoctor(prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_addressdoctors", resp.data.records.addressdoctors)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
}
}
}

View File

@@ -0,0 +1,549 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/regional.js"
export default {
namespaced: true,
state: {
last_id: -1,
act: 'new',
lookup_regional: 0,
lookup_error_message: '',
regionals: [],
total_regionals: 0,
total_filter_regionals: 0,
selected_regional: {
name: ""
},
save_status: 0,
save_error_message: '',
dialog_form_regional: false,
dialog_edit_form_regional: false,
alert_success: false,
msg_success: "",
show_all: 'N',
errors: [],
regionaltypes: [],
regionaltype: {},
doctors: [],
doctor: {},
get_data_status: 0,
get_data_error_message: '',
cities: [],
branch_address: {},
autocomplete_status: 0,
search_status: 0,
districts: [],
district_address: {},
kelurahans: [],
kelurahan_address: {},
instruments: [],
instrument: {},
autotemplates: [],
autotemplate: {},
nonlabs: [],
selected_nonlab: {},
current_page:1,
x_search: ''
},
mutations: {
update_x_search(state, val) {
state.x_search = val
},
update_current_page(state, val) {
state.current_page = val
},
update_last_id(state, val) {
state.last_id = val
},
update_act(state, val) {
state.act = val
},
update_errors(state, val) {
state.errors = val
},
update_show_all(state, val) {
state.show_all = val
},
update_lookup_error_message(state, status) {
state.lookup_error_message = status
},
update_lookup_regional(state, status) {
state.lookup_regional = status
},
update_regionals(state, data) {
state.regionals = data.records
state.total_regionals = data.total
state.total_filter_regionals = data.total_filter
},
update_selected_regional(state, val) {
state.selected_regional = val
},
update_save_status(state, val) {
state.save_status = val
},
update_save_error_message(state, val) {
state.save_error_message = val
},
update_dialog_form_regional(state, val) {
state.dialog_form_regional = val
},
update_dialog_edit_form_regional(state, val) {
state.dialog_edit_form_regional = val
},
update_alert_success(state, val) {
state.alert_success = val
},
update_msg_success(state, val) {
state.msg_success = val
},
update_regionaltypes(state, data) {
state.regionaltypes = data
},
update_regionaltype(state, val) {
state.regionaltype = val
},
update_doctors(state, data) {
state.doctors = data
},
update_doctor(state, val) {
state.doctor = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_get_data_error_message(state, val) {
state.get_data_error_message = val
},
update_cities(state, val) {
state.cities = val
},
update_branch_address(state, val) {
state.branch_address = val
},
update_autocomplete_status(state, val) {
state.autocomplete_status = val
},
update_districts(state, val) {
state.districts = val
},
update_district_address(state, val) {
state.district_address = val
},
update_kelurahans(state, val) {
state.kelurahans = val
},
update_kelurahan_address(state, val) {
state.kelurahan_address = val
},
update_instruments(state, data) {
state.instruments = data
},
update_instrument(state, val) {
state.instrument = val
},
update_autotemplates(state, data) {
state.autotemplates = data
},
update_autotemplate(state, val) {
state.autotemplate = val
},
update_nonlabs(state, val) {
state.nonlabs = val
},
update_selected_nonlab(state, val) {
state.selected_nonlab = val
}
},
actions: {
async lookup(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookup(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbybranch(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbybranch(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbydistrict(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbydistrict(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbykelurahan(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbykelurahan(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbyname(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbyname(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
var pat = data.records[0]
if(prm.regional != ""){
context.commit("branch/update_autoregionals", [{
S_RegionalID: pat.S_RegionalID,
S_RegionalName: pat.S_RegionalName
}], { root: true })
context.commit("branch/update_autoregional", {
S_RegionalID: pat.S_RegionalID,
S_RegionalName: pat.S_RegionalName
},{ root: true })
}
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async save(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_save_error_message", resp.message)
var data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_errors", [])
context.commit("update_alert_success", true)
context.commit("update_dialog_form_regional", false)
var msg =" Regional " + prm.name + " sudah tersimpan dong ..."
context.commit("update_msg_success", msg)
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
} else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async update(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.update(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_save_error_message", resp.message)
let data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_alert_success", true)
context.commit("update_dialog_form_regional", false)
var msg = " Regional " + prm.name + " sudah terupdate dong ..."
context.commit("update_msg_success", msg)
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
}else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async delete(context, prm) {
context.commit("update_save_status", 1)
try {
let resp = await api.xdelete(one_token(), prm.regionalid)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_alert_success", true)
var msg = " Regional " + prm.name + " sudah dihapus dong"
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.commit("update_selected_regional", {})
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
}
} catch (e) {
context.commit("update_save_status", 3)
console.log(e)
}
},
async selectnonlab(context) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.selectnonlab(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_nonlabs", resp.data.records.nonlabs)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
},
async selectdoctor(context) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.selectdoctor(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_doctors", resp.data.records.doctors)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
},
async searchbranch(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchbranch(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_cities", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchdoctor(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchdoctor(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_doctors", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchinstrument(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchinstrument(one_token(), prm.tes)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_instruments", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchtemplate(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchtemplate(one_token(), prm.tes)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_autotemplates", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async getdistrict(context, prm) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getdistrict(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_districts", resp.data.records)
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
},
async getkelurahan(context, prm) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getkelurahan(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_kelurahans", resp.data.records)
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
}
}
}

View File

@@ -0,0 +1,25 @@
// State
// data ...
// Mutations
//
//
// Actions
import regional from "./modules/regional.js";
import branch from "./modules/branch.js";
import system from "../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
regional: regional,
branch: branch,
system:system
},
state: {
},
mutations: {
},
actions: {
}
});

View File

@@ -0,0 +1,220 @@
const URL = "/one-api/v1/regonline/";
export async function save(prm) {
try {
var resp = await axios.post(URL + 'resultoption/addnewresultoption', 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 getresultoption(token) {
try {
var resp = await axios.post(URL + 'resultoption/getresultoption',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(token,id) {
try {
var resp = await axios.post(URL + 'resultoption/deleteattribute', { id: id ,token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchtest(prm) {
try {
var resp = await axios.post(URL + 'resultoption/searchtest',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 searchsubcategory(prm) {
try {
var resp = await axios.post(URL + 'resultoption/searchsubcategory',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 searchdistrict(prm) {
try {
var resp = await axios.post(URL + 'resultoption/searchdistrict',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 searchkelurahan(prm) {
try {
var resp = await axios.post(URL + 'resultoption/searchkelurahan',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcompany(prm) {
try {
var resp = await axios.post(URL + 'resultoption/searchcompany',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchmou(prm) {
try {
var resp = await axios.post(URL + 'resultoption/searchmou',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchdoctor(prm) {
try {
var resp = await axios.post(URL + 'resultoption/searchdoctor',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function lookupbyname(prm) {
try {
var resp = await axios.post(URL + 'resultoption/lookupattributebyname', 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 selectaddressdoctor(prm) {
try {
var resp = await axios.post(URL + 'resultoption/selectaddressdoctor',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
};
}
}

View File

@@ -0,0 +1,279 @@
const URL = "/one-api/mockup/masterdata/";
export async function lookup(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookup', 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 lookupbybranch(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbybranch', 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 lookupbydistrict(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbydistrict', 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 lookupbykelurahan(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbykelurahan', 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 lookupbyname(prm) {
try {
var resp = await axios.post(URL + 'branchv2/lookupregionalbyname', 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 + 'branchv2/addnewregional', 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 update(prm) {
try {
var resp = await axios.post(URL + 'branchv2/editregional', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(token,id) {
try {
var resp = await axios.post(URL + 'branchv2/deleteregional', { id: id, token:token });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function selectnonlab(token) {
try {
var resp = await axios.post(URL + 'branchv2/selectnonlab',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchbranch(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/searchbranch',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchdoctor(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/searchdoctor',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchinstrument(token,tes) {
try {
var resp = await axios.post(URL + 'branchv2/searchinstrument',{token:token,search:tes});
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 searchtemplate(token,tes) {
try {
var resp = await axios.post(URL + 'branchv2/searchtemplate',{token:token,search:tes});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdistrict(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/getdistrict',{id:prm.M_BranchID,token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getkelurahan(token,prm) {
try {
var resp = await axios.post(URL + 'branchv2/getkelurahan',{token:token,id:prm.M_DistrictID});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,880 @@
<template>
<v-layout>
<v-flex xs12>
<v-card class="mb-2" color="white">
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>PILIHAN HASIL</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormBranch(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
<v-list-tile>
<input type="text" v-model="xsearch" class="textinput" label="Nama Station" placeholder="Cari ..." />
</v-list-tile-content>
</v-list-tile>
</v-layout>
<v-divider></v-divider>
<v-layout row wrap class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="branchs" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.T_TestSasCode">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)" v-html="props.item.T_TestName">
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-layout row wrap>
<v-flex v-for="(p, i) in props.item.resultoptionx" v-bind:key="i">
<v-btn class="mt-1 mb-2" small :color="'green'">{{ p.optionname }}</v-btn>
</v-flex>
</v-layout>
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-icon small class="ml-3" color="primary" @click="editFormBranch(props.item)">edit</v-icon>
<v-icon small class="ml-3" color="error" @click="deleteFormBranch(props.item)">clear</v-icon>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
<template>
<v-layout row justify-center>
<v-dialog v-model="dialogbranch" persistent max-width="750px">
<v-card>
<v-card-title>
<span class="headline">FORM PILIHAN HASIL</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formregionalbranch" v-model="validbranch" lazy-validation>
<v-layout wrap>
<v-flex xs12>
<v-autocomplete label="Pemeriksaan*" v-model="xautotest" :items="xautotests" :search-input.sync="search_test" auto-select-first
no-filter item-text="T_TestName" return-object no-data-text="Cari Pemeriksaan"
small :rules="regionalRules" required>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.T_TestName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex xs12>
<span>Pilihan :</span>
<v-btn class="mt-1 mb-2" v-for="(vst,idx) in xorderregtimes" :key="vst.id" @click="changeDay(idx)" small :color="vst.isresultoption === 'N' ? 'yellow' : 'green'">{{vst.T_ResultOptionName}}
</v-btn>
</v-flex>
<v-flex xs12>
</v-flex>
<v-flex xs12>
</v-flex>
<v-flex xs12>
</v-flex>
<v-flex xs12>
<span>Keterangan :</span>
</v-flex>
<v-flex xs12>
<span>Pilih :</span>
<v-btn class="mt-1 mb-2" small :color="'green'">
</v-btn>
<span>Tidak Dipilih :</span>
<v-btn class="mt-1 mb-2" small :color="'yellow'">
</v-btn>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormBranch()">Tutup</v-btn>
<v-btn color="blue darken-1" flat @click="saveFormBranch()">Simpan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</v-layout>
</template>
</v-card>
</v-flex>
<one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprint" :urlprint="urlprint" @close-dialog-print="closePrint"></one-dialog-print>
<template>
<v-dialog v-model="dialogdeletealertbranch" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalertbranch}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealertbranch = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlertBranch()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.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;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
components: {
'one-date-picker': httpVueLoader('../../../common/oneDatePicker.vue'),
'one-dialog-print': httpVueLoader('../../../common/oneDialogPrintX.vue')
},
data() {
return {
query: "",
items: [],
openprint: false,
urlprint: '',
printtitle: '',
printwidth: 600,
formatreport: 'pdf',
readonlydefault: false,
page: 1,
xname: '',
xphone: '',
xcode: '',
xaddress: '',
xipaddress: '',
xbasename: '',
xshortattribute: '',
xdescattribute: '',
isdefault: false,
issatellite: false,
search_test: '',
search_subcategory: '',
search_district: '',
search_kelurahan: '',
search_company: '',
search_mou: '',
search_doctor: '',
shortRules: [
v => !!v || 'Atribut Singkat harus diisi'
],
descRules: [
v => !!v || 'Atribut Deskripsi harus diisi'
],
addressRules: [
v => !!v || 'Alamat harus diisi'
],
xipaddressRules: [
v => !!v || 'Alamat IP harus diisi'
],
regionalRules: [
v => !!v || 'Regional harus dipilih'
],
subcategoryRules: [
v => !!v || 'Kategori harus dipilih'
],
districtRules: [
v => !!v || 'Kecamatan harus dipilih'
],
kelurahanRules: [
v => !!v || 'Kelurahan harus dipilih'
],
headers: [{
text: "KODE",
align: "left",
sortable: false,
value: "lab",
width: "15%",
class: "blue lighten-3 white--text"
},
{
text: "PEMERIKSAAN",
align: "left",
sortable: false,
value: "name",
width: "40%",
class: "blue lighten-3 white--text"
},
{
text: "PILIHAN HASIL",
align: "left",
sortable: false,
value: "name",
width: "25%",
class: "blue lighten-3 white--text"
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "status",
width: "10%",
class: "blue lighten-3 white--text"
}
],
pagination: {
descending: false,
page: 1,
rowsPerPage: 100,
sortBy: 'M_BranchName ASC',
totalItems: this.$store.state.branch.total_transactions
},
statuss: [{
waktu: '16-07-2019 10:00',
status: 'Order Dibuat',
branch: 'Nagita Slavina'
},
{
waktu: '16-07-2019 11:00',
status: 'Order Dikirim',
branch: 'Nagita Slavina'
},
{
waktu: '16-07-2019 12:00',
status: 'Order dikonfirmasi',
branch: 'Chacha Frederica'
},
{
waktu: '16-07-2019 13:00',
status: 'Telah dibuat Surat Jalan',
branch: 'Chacha Frederica'
},
{
waktu: '16-07-2019 14:00',
status: 'Kurir akan mengambil sampel',
branch: 'Satria Subiantoro'
}
],
color: "success",
validbranch: false,
xid: 0,
isinput: "N",
countprice: 0,
branchbranchid: 0,
branchxname: "",
branchlang: "",
branchtext: "",
isadvance: "N",
branchformatadvance: "",
issenttoregional: "N",
menustartdate: false,
menuenddate: false,
date: new Date().toISOString().substr(0, 10),
dialogdeletealertbranch: false,
dialogverifyalertbranch: false,
dialogreleasealertbranch: false,
alertverify: false,
dialogunreleasealertbranch: false,
dialogunverifyalertbranch: false,
msgalertbranch: ""
};
},
mounted() {
this.$store.dispatch("branch/getresultoption")
this.$store.dispatch("branch/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
},
computed: {
branchs() {
return this.$store.state.branch.branchs
},
xregional() {
return this.$store.state.regional.selected_regional
},
dialogbranch() {
return this.$store.state.branch.dialog_form_branch
},
xerrors() {
return this.$store.state.branch.errors
},
isLoading() {
return this.$store.state.branch.search_status == 1
},
startComputedDateFormatted() {
return this.formatDate(this.xstartdate)
},
xorderregtimes() {
xregtimes = this.$store.state.branch.orderregtimes;
console.log('xregtimes', xregtimes)
return xregtimes
},
xstartdate: {
get() {
return this.$store.state.branch.startdate
},
set(val) {
this.$store.commit("branch/update_startdate", val)
}
},
endComputedDateFormatted() {
return this.formatDate(this.xenddate)
},
xenddate: {
get() {
return this.$store.state.branch.enddate
},
set(val) {
this.$store.commit("branch/update_enddate", val)
}
},
xautosubcategorys() {
return this.$store.state.branch.autosubcategorys
},
xautosubcategory: {
get() {
return this.$store.state.branch.autosubcategory
},
set(val) {
this.$store.commit("branch/update_autosubcategory", val)
this.$store.dispatch("branch/searchdistrict", {
search: this.search_district,
id: val.T_SubCategoryID
})
}
},
xautodistricts() {
return this.$store.state.branch.autodistricts
},
xautodistrict: {
get() {
return this.$store.state.branch.autodistrict
},
set(val) {
this.$store.commit("branch/update_autodistrict", val)
this.$store.dispatch("branch/searchkelurahan", {
search: this.search_kelurahan,
id: val.M_DistrictID
})
}
},
xautokelurahans() {
return this.$store.state.branch.autokelurahans
},
xautokelurahan: {
get() {
return this.$store.state.branch.autokelurahan
},
set(val) {
this.$store.commit("branch/update_autokelurahan", val)
}
},
xautocompanys() {
return this.$store.state.branch.autocompanys
},
xautocompany: {
get() {
return this.$store.state.branch.autocompany
},
set(val) {
this.$store.commit("branch/update_autocompany", val)
this.$store.dispatch("branch/searchmou", {
search: this.search_mou,
id: val.M_CompanyID
})
}
},
xautomous() {
return this.$store.state.branch.automous
},
xautomou: {
get() {
return this.$store.state.branch.automou
},
set(val) {
this.$store.commit("branch/update_automou", val)
}
},
xautodoctors() {
return this.$store.state.branch.autodoctors
},
xautodoctor: {
get() {
return this.$store.state.branch.autodoctor
},
set(val) {
this.$store.commit("branch/update_autodoctor", val)
this.$store.dispatch("branch/selectaddressdoctor", {
id: val.M_DoctorID
})
}
},
xaddressdoctors() {
return this.$store.state.branch.addressdoctors
},
xaddressdoctor: {
get() {
return this.$store.state.branch.addressdoctor
},
set(val) {
this.$store.commit("branch/update_addressdoctor", val)
}
},
xstatuss() {
return this.$store.state.branch.statuss
},
dialogstatusorder() {
return this.$store.state.branch.dialog_status_order
},
xautotests() {
return this.$store.state.branch.autotests
},
xautotest: {
get() {
return this.$store.state.branch.autotest
},
set(val) {
this.$store.commit("branch/update_autotest", val)
}
},
xsearch: {
get() {
return this.$store.state.branch.x_search
},
set(val) {
this.$store.commit("branch/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.branch.current_page
},
set(val) {
this.$store.commit("branch/update_current_page", val)
this.$store.dispatch("branch/lookupbyname", {
regional: this.$store.state.regional.x_search,
branch: this.xsearch,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.branch.total_data
},
set(val) {
this.$store.commit("branch/update_total_data", val)
}
}
},
methods: {
isSelected(p) {
return p.id == this.$store.state.branch.selected_branch.id
},
selectMe(sc) {
this.$store.commit("branch/update_selected_branch", sc)
},
updateDialogFormBranch() {
this.$store.commit("branch/update_dialog_form_branch", false)
},
updateDialogStatusOrder() {
this.$store.commit("branch/update_dialog_status_order", false)
},
setStatusOrder(val) {
this.$store.commit("branch/update_branchs", {})
this.$store.commit("branch/update_dialog_status_order", true)
this.$store.commit("branch/update_statuss", val.statuss)
},
changeDay(idx) {
var arrOrders = this.$store.state.branch.orderregtimes
arrOrders[idx].isresultoption = arrOrders[idx].isresultoption == 'N' ? 'Y' : 'N'
this.$store.commit("branch/update_orderregtimes", arrOrders)
},
doPriceList(val) {
console.log(location)
var id = val.id
location.replace("/one-ui/regional/vuex/one-md-price/" + "?id=" + id)
},
doPrice() {
console.log(location)
var id = this.xid
location.replace("/one-ui/regional/vuex/one-md-price/" + "?id=" + id)
},
thr_search_test: _.debounce(function () {
this.$store.dispatch("branch/searchtest", {
tes: this.search_test
})
}, 200),
thr_search_subcategory: _.debounce(function () {
this.$store.dispatch("branch/searchsubcategory", {
search: this.search_subcategory
})
}, 200),
thr_search_district: _.debounce(function () {
this.$store.dispatch("branch/searchdistrict", {
search: this.search_district,
id: this.xautosubcategory.T_SubCategoryID
})
}, 200),
thr_search_kelurahan: _.debounce(function () {
this.$store.dispatch("branch/searchkelurahan", {
search: this.search_kelurahan,
id: this.xautodistrict.M_DistrictID
})
}, 200),
thr_search: _.debounce(function () {
this.$store.dispatch("regional/lookupbyname", {
regional: this.$store.state.regional.x_search,
branch: this.xsearch,
current_page: 1,
lastid: -1
})
this.$store.dispatch("branch/lookupbyname", {
regional: this.$store.state.regional.x_search,
branch: this.xsearch,
current_page: 1,
lastid: -1
})
}, 200),
thr_search_company: _.debounce(function () {
this.$store.dispatch("branch/searchcompany", {
search: this.search_company
})
}, 200),
thr_search_mou: _.debounce(function () {
this.$store.dispatch("branch/searchmou", {
search: this.search_mou,
id: this.xautocompany.M_CompanyID
})
}, 200),
thr_search_doctor: _.debounce(function () {
this.$store.dispatch("branch/searchdoctor", {
search: this.search_doctor
})
}, 200),
searchRegional() {
this.$store.dispatch("branch/lookup", {
id: this.xregional.name === "" ? "0" : this.$store.state.regional.selected_regional
.id,
search: this.xsearch,
current_page: 1,
lastid: -1
})
},
doPrint() {
console.log('doprint')
this.printwidth = 1028
this.printtitle = ""
let branch = one_branch()
var id = this.xid
var d = new Date();
var n = d.getTime()
var rptname = 'regional_price'
var formatrpt = this.formatreport
this.urlprint = "/birt/run?__report=report/one/md/" + rptname +
".rptdesign&__format=" +
formatrpt + "&PBranchID=" + id + "&branchxname=" + branch.M_BranchBranchname +
"&tm=" + n
this.openprint = true
},
closePrint() {
this.openprint = false
},
openFormBranch(val) {
this.xid = val
this.xshortattribute = ''
this.xdescattribute = ''
this.$store.commit("branch/update_autotests", [])
this.$store.commit("branch/update_autotest", {})
this.$store.commit("branch/update_autosubcategorys", [])
this.$store.commit("branch/update_autosubcategory", {})
this.$store.commit("branch/update_dialog_form_branch", true)
},
editFormBranch(val) {
this.xid = val.id
this.xshortattribute = val.T_TestAttributeShortDescription
this.xdescattribute = val.T_TestAttributeDescription
this.$store.commit("branch/update_autotests", [{
T_TestID: val.T_TestID,
T_TestName: val.T_TestName
}])
this.isresultoption = val.isresultoption === 'N' ? false : true
this.$store.commit("branch/update_orderregtimes", val.resultoptions)
this.$store.commit("branch/update_autotest", {
T_TestID: val.T_TestID,
T_TestName: val.T_TestName
})
this.$store.commit("branch/update_autosubcategorys", [{
T_SubCategoryID: val.T_SubCategoryID,
T_SubCategoryName: val.T_SubCategoryName
}])
this.$store.commit("branch/update_autosubcategory", {
T_SubCategoryID: val.T_SubCategoryID,
T_SubCategoryName: val.T_SubCategoryName
})
this.$store.commit("branch/update_dialog_form_branch", true)
},
checkError(value) {
var errors = this.$store.state.branch.errors
if (errors.includes(value)) {
return true
} else {
return false
}
},
saveFormBranch() {
if (this.$refs.formregionalbranch.validate()) {
this.$store.dispatch("branch/save", {
xid: this.xid,
testid: this.xautotest ? this.$store.state.branch.autotest.T_TestID : 0,
testname: this.$store.state.branch.autotest.T_TestName,
orderregtimes: this.xorderregtimes,
sbranch: this.xsearch
})
}
},
set_date2(x) {
this.startdate = x.new_date
},
set_date3(x) {
this.enddate = x.new_date
},
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')}`
},
updateAlert_success(val) {
this.$store.commit("regional/update_alert_success", val)
},
deleteFormBranch(data) {
this.xid = data.id
this.msgalertbranch = "Yakin, mau hapus attribut ini?"
this.dialogdeletealertbranch = true
},
closeDeleteAlertBranch() {
this.$store.dispatch("branch/delete", {
xid: this.xid,
regionalid: this.$store.state.branch.autotest.T_TestID,
regionalname: this.$store.state.branch.autotest.T_TestName,
name: this.xname,
sregional: this.$store.state.regional.x_search,
sbranch: this.xsearch
})
this.dialogdeletealertbranch = false
}
},
watch: {
xsearch(val, old) {
console.log(val)
this.xsearch = val
this.thr_search()
},
search_test(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_test()
},
search_subcategory(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_subcategory()
},
search_district(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_district()
},
search_kelurahan(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_kelurahan()
},
search_company(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_company()
},
search_mou(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_mou()
},
search_doctor(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.branch.update_autocomplete_status == 1) return
this.thr_search_doctor()
}
}
}
</script>

View File

@@ -0,0 +1,620 @@
<template>
<v-layout>
<template>
<v-dialog v-model="dialogdeletealert" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalert}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealert = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlert()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogregional" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">FORM REGIONAL</span></v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formregional" v-model="valid" lazy-validation>
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="xname" label="Nama*" :rules="xnameRules" required></v-text-field>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormRegional()">Tutup</v-btn>
<v-btn v-if="xact === 'new'" color="blue darken-1" flat @click="saveFormRegional()">Simpan</v-btn>
<v-btn v-if="xact === 'edit'" color="blue darken-1" flat @click="updateFormRegional()">Simpan Perubahan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</template>
<v-flex xs12>
<v-card>
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>REGIONAL</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormRegional(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-snackbar v-model="snackbar" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
{{msgsnackbar}}
<v-btn flat @click="updateAlert_success(false)">
Tutup
</v-btn>
</v-snackbar>
<v-layout row style="background:#bbdefb;padding-top:5px;" justify-left>
<v-list-tile>
<input type="text" v-model="xsearch" class="textinput" label="Nama Station" placeholder="Cari ..." />
</v-list-tile-content>
</v-list-tile>
</v-layout>
<v-divider></v-divider>
<div>
<v-layout row class="scroll-container" style="max-height:600px;overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="vregionals" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.namex}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-icon small class="ml-3" color="primary" @click="editRegional(props.item)">edit</v-icon>
<v-icon small class="ml-3" color="error" @click="deleteRegional(props.item)">clear</v-icon>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
</div>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.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;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
data() {
return {
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
dialogdeletealert: false,
msgalert: "",
valid: false,
xid: 0,
search_instrument: '',
items: [],
xname: '',
xcode: '',
xnameRules: [
v => !!v || 'Nama harus diisi'
],
instrumentRules: [
v => !!v || 'Instrument harus dipilih'
],
name: '',
isdefault: false,
scode: '',
search_doctor: '',
search_testheader: '',
search_template: '',
page: 1,
headers: [{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
pagination: {
descending: true,
page: 1,
rowsPerPage: 100,
sortBy: 'id DESC',
totalItems: this.$store.state.regional.total_filter_regionals
}
};
},
mounted() {
this.$store.dispatch("branch/selectaddressdoctor", {
id: 0
})
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
this.$store.dispatch("branch/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
},
computed: {
xact() {
return this.$store.state.regional.act
},
xerrors() {
return this.$store.state.regional.errors
},
xshowall() {
return this.$store.state.regional.show_all
},
vregionals() {
return this.$store.state.regional.regionals
},
xtotalregionals() {
return this.$store.state.regional.total_regionals
},
xtotalfilterregionals() {
return this.$store.state.regional.total_filter_regionals
},
xsearch: {
get() {
return this.$store.state.regional.x_search
},
set(val) {
this.$store.commit("regional/update_x_search", val)
}
},
curr_page: {
get() {
return this.$store.state.regional.current_page
},
set(val) {
this.$store.commit("regional/update_current_page", val)
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.regional.total_regionals
},
set(val) {
this.$store.commit("regional/update_total_regionals", val)
}
},
dialogregional() {
return this.$store.state.regional.dialog_form_regional
},
snackbar: {
get() {
return this.$store.state.regional.alert_success
},
set(val) {
this.$store.commit("regional/update_alert_success", val)
}
},
msgsnackbar() {
return this.$store.state.regional.msg_success
},
lookupstatus() {
return this.$store.state.regional.lookup_regional
},
xregionaltypes() {
return this.$store.state.regional.regionaltypes
},
xregionaltype: {
get() {
return this.$store.state.regional.regionaltype
},
set(val) {
this.$store.commit("regional/update_regionaltype", val)
}
},
isLoading() {
return this.$store.state.regional.search_status == 1
},
xnonlabs() {
return this.$store.state.regional.nonlabs
},
xnonlab: {
get() {
return this.$store.state.regional.selected_nonlab
},
set(val) {
this.$store.commit("regional/update_selected_nonlab", val)
}
},
xcities() {
return this.$store.state.regional.cities
},
branchaddress: {
get() {
return this.$store.state.regional.branch_address
},
set(val) {
this.$store.commit("regional/update_branch_address", val)
this.$store.dispatch("regional/getdistrict", this.$store.state.regional.branch_address)
}
},
xdoctors() {
return this.$store.state.regional.doctors
},
doctor: {
get() {
return this.$store.state.regional.doctor
},
set(val) {
this.$store.commit("regional/update_doctor", val)
}
},
xinstruments() {
return this.$store.state.regional.instruments
},
xinstrument: {
get() {
return this.$store.state.regional.instrument
},
set(val) {
this.$store.commit("regional/update_instrument", val)
}
},
xautotemplates() {
return this.$store.state.regional.autotemplates
},
xautotemplate: {
get() {
return this.$store.state.regional.autotemplate
},
set(val) {
this.$store.commit("regional/update_autotemplate", val)
}
},
xdistricts() {
return this.$store.state.regional.districts
},
districtaddress: {
get() {
return this.$store.state.regional.district_address
},
set(val) {
this.$store.commit("regional/update_district_address", val)
this.$store.dispatch("regional/getkelurahan", this.$store.state.regional.district_address)
}
},
xkelurahans() {
return this.$store.state.regional.kelurahans
},
kelurahanaddress: {
get() {
return this.$store.state.regional.kelurahan_address
},
set(val) {
this.$store.commit("regional/update_kelurahan_address", val)
}
}
},
methods: {
updateShowAll(val) {
this.$store.commit("regional/update_show_all", val)
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: this.curr_page,
lastid: -1
})
},
searchRegional() {
this.$store.dispatch("regional/lookup", {
search: this.xsearch,
current_page: 1,
lastid: -1
})
},
isSelected(p) {
return p.id == this.$store.state.regional.selected_regional.id
},
subname(name) {
var xname = name
if (xname.length > 18) {
xname = xname.substring(0, 18) + '...'
}
return xname
},
selectMe(sc) {
this.$store.commit("regional/update_selected_regional", sc)
this.$store.dispatch("branch/lookupbyname", {
regional: this.$store.state.regional.selected_regional.name,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
this.$store.commit("branch/update_autoregionals", [{
S_RegionalID: this.$store.state.regional.selected_regional.id,
S_RegionalName: this.$store.state.regional.selected_regional.name
}])
this.$store.commit("branch/update_autoregional", {
S_RegionalID: this.$store.state.regional.selected_regional.id,
S_RegionalName: this.$store.state.regional.selected_regional.name
})
},
updateDialogFormRegional() {
this.$store.commit("regional/update_dialog_form_regional", false)
},
openFormRegional() {
this.xcode = ""
this.xname = ""
this.isdefault = "N"
this.$refs.formregional.reset()
this.$refs.formregional.resetValidation()
this.$store.commit("regional/update_act", 'new')
this.$store.commit("regional/update_dialog_form_regional", true)
},
thr_search_instrument: _.debounce(function () {
this.$store.dispatch("regional/searchinstrument", {
tes: this.search_instrument
})
}, 2000),
saveFormRegional() {
if (this.$refs.formregional.validate()) {
this.$store.dispatch("regional/save", {
name: this.xname,
sregional: this.xsearch,
sbranch: this.$store.state.branch.x_search
})
}
},
updateFormRegional() {
if (this.$refs.formregional.validate()) {
this.$store.dispatch("regional/update", {
id: this.xid,
name: this.xname,
sregional: this.xsearch,
sbranch: this.$store.state.branch.x_search
})
}
},
updateAlert_success(val) {
this.$store.commit("regional/update_alert_success", val)
},
editRegional(data) {
this.xid = data.id
this.xcode = data.code
this.xname = data.name
this.isdefault = data.S_RegionalIsDefault === 'N' ? false : true
this.$store.commit("regional/update_act", 'edit')
this.$store.commit("regional/update_dialog_form_regional", true)
},
deleteRegional(data) {
this.xid = data.id
var xdata = {
id: data.id,
name: data.name,
branchs: 'xxx'
}
this.$store.commit("regional/update_selected_regional", xdata)
this.msgalert = "Yakin, mau hapus regional " + data.name + " ?"
this.dialogdeletealert = true
},
changeNewRegionalType(value) {
this.readonlytyperegional = value === true ? true : false
this.readonlytyperegionalnew = value === true ? false : true
},
newRegionalType() {
readonlytyperegional: true
readonlytyperegionalnew: false
},
closeDeleteAlert() {
this.$store.dispatch("regional/delete", {
regionalid: this.$store.state.regional.selected_regional.id,
xname: this.$store.state.regional.selected_regional.name,
sregional: this.xsearch,
sbranch: this.$store.state.branch.x_search
})
this.dialogdeletealert = false
},
thr_search: _.debounce(function () {
this.$store.dispatch("regional/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
this.$store.dispatch("branch/lookupbyname", {
regional: this.xsearch,
branch: this.$store.state.branch.x_search,
current_page: 1,
lastid: -1
})
}, 1000)
},
watch: {
xsearch(val, old) {
console.log(val)
this.xsearch = val
this.thr_search()
},
search_instrument(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.regional.update_autocomplete_status == 1) return
this.thr_search_instrument()
}
}
}
</script>

View File

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

View File

@@ -0,0 +1,504 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/branch.js"
export default {
namespaced: true,
state: {
branchs: [],
save_status: 0,
save_error_message: '',
dialog_form_branch: false,
dialog_status_order: false,
lookup_branch: 0,
search_status: 0,
errors: [],
startdate: moment(new Date()).format('YYYY-MM-DD'),
enddate: moment(new Date()).format('YYYY-MM-DD'),
bases: [],
base: {},
omzettypes: [],
omzettype: {},
branchtypes: [],
branchtype: {},
agingtypes: [],
agingtype: {},
statuss: [],
autotests:[],
autotest:{},
autosubcategorys:[],
autosubcategory:{},
autodistricts:[],
autodistrict:{},
autokelurahans:[],
autokelurahan:{},
autocompanys:[],
autocompany:{},
automous:[],
automou:{},
autodoctors:[],
autodoctor:{},
addressdoctors:[],
addressdoctor:{},
current_page:1,
x_search: '',
total_data: 0,
selected_branch: {
name: ""
},
get_data_status: 0,
get_data_error_message: '',
orderregtimes:[]
},
mutations: {
update_orderregtimes(state,data){
state.orderregtimes = data
},
update_selected_branch(state, val) {
state.selected_branch = val
},
update_x_search(state, val) {
state.x_search = val
},
update_current_page(state, val) {
state.current_page = val
},
update_total_data(state, val) {
state.total_data = val
},
update_autotests(state,data){
state.autotests = data
},
update_autotest(state,val){
state.autotest = val
},
update_autosubcategorys(state,data){
state.autosubcategorys = data
},
update_autosubcategory(state,val){
state.autosubcategory = val
},
update_autocompanys(state,data){
state.autocompanys = data
},
update_autocompany(state,val){
state.autocompany = val
},
update_automous(state,data){
state.automous = data
},
update_automou(state,val){
state.automou = val
},
update_autodoctors(state,data){
state.autodoctors = data
},
update_autodoctor(state,val){
state.autodoctor = val
},
update_addressdoctors(state,data){
state.addressdoctors = data
},
update_addressdoctor(state,val){
state.addressdoctor = val
},
update_autodistricts(state,data){
state.autodistricts = data
},
update_autodistrict(state,val){
state.autodistrict = val
},
update_autokelurahans(state,data){
state.autokelurahans = data
},
update_autokelurahan(state,val){
state.autokelurahan = val
},
update_errors(state, val) {
state.errors = val
},
update_branchs(state, data) {
state.branchs = data
},
update_save_status(state, val) {
state.save_status = val
},
update_save_error_message(state, val) {
state.save_error_message = val
},
update_dialog_form_branch(state, val) {
state.dialog_form_branch = val
},
update_lookup_branch(state, val) {
state.lookup_branch = val
},
update_startdate(state, val) {
state.startdate = val
},
update_enddate(state, val) {
state.enddate = val
},
update_bases(state, data) {
state.bases = data
},
update_base(state, val) {
state.base = val
},
update_omzettypes(state, data) {
state.omzettypes = data
},
update_omzettype(state, val) {
state.omzettype = val
},
update_branchtypes(state, data) {
state.branchtypes = data
},
update_branchtype(state, val) {
state.branchtype = val
},
update_agingtypes(state, data) {
state.agingtypes = data
},
update_agingtype(state, val) {
state.agingtype = val
},
update_search_status(state, val) {
state.search_status = val
},
update_statuss(state, data) {
state.statuss = data
},
update_dialog_status_order(state, val) {
state.dialog_status_order = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_get_data_error_message(state, val) {
state.get_data_error_message = val
}
},
actions: {
async save(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
var data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("regional/update_alert_success", true, {
root: true
})
context.commit("update_dialog_form_branch", false)
var msg = "Cabang " + prm.name + " Regional " + prm.regionalname + " sudah disimpan dong"
context.commit("regional/update_msg_success", msg, {
root: true
})
context.commit("regional/update_alert_success", true, {
root: true
})
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
current_page: 1,
lastid: -1
})
} else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async lookupx(context, prm) {
context.commit("update_lookup_branch", 1)
try {
let resp = await api.lookupx(one_token(), prm.id)
if (resp.status != "OK") {
context.commit("update_lookup_branch", 3)
} else {
context.commit("update_lookup_branch", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_branchs", data.records)
}
} catch (e) {
context.commit("update_lookup_branch", 3)
}
},
async getresultoption(context) {
context.commit("update_save_status", 1)
try {
let resp = await api.getresultoption(one_token())
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_orderregtimes", data.records.resultoptions)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async lookup(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.lookup(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_branchs", data.records)
console.log('status')
console.log(data.records.statuss)
context.commit("update_statuss", data.records.statuss)
context.commit("update_total_data", data.total)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async lookupbyname(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.lookupbyname(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_branchs", data.records)
console.log(data.records)
context.commit("update_total_data", data.total)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
async delete(context, prm) {
context.commit("update_save_status", 1)
try {
let resp = await api.xdelete(one_token(), prm.xid)
if (resp.status != "OK") {
context.commit("regional/update_save_status", 3, {
root: true
})
context.commit("regional/update_save_error_message", resp.message, {
root: true
})
} else {
context.commit("regional/update_save_status", 2, {
root: true
})
context.commit("regional/update_save_error_message", resp.message, {
root: true
})
context.commit("regional/update_alert_success", true, {
root: true
})
//context.commit("update_dialog_form_schedule_promise", false)
var msg = "Cabang sudah dihapus dong"
context.commit("regional/update_msg_success", msg, {
root: true
})
context.commit("regional/update_alert_success", true, {
root: true
})
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
current_page: 1,
lastid: -1
})
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async searchtest(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchtest(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autotests",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchsubcategory(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchsubcategory(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autosubcategorys",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchdistrict(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchdistrict(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autodistricts",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchkelurahan(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchkelurahan(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autokelurahans",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchcompany(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchcompany(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autocompanys",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchmou(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchmou(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_automous",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async searchdoctor(context,prm) {
context.commit("regional/update_autocomplete_status",1,{root: true})
try {
prm.token = one_token()
let resp= await api.searchdoctor(prm)
if (resp.status != "OK") {
context.commit("regional/update_autocomplete_status",3,{root: true})
} else {
context.commit("regional/update_autocomplete_status",2,{root: true})
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_autodoctors",resp.data.records)
}
} catch(e) {
context.commit("regional/update_autocomplete_status",3,{root: true})
}
},
async selectaddressdoctor(context,prm) {
context.commit("update_get_data_status", 1)
try {
prm.token = one_token()
let resp = await api.selectaddressdoctor(prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_addressdoctors", resp.data.records.addressdoctors)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
}
}
}

View File

@@ -0,0 +1,549 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/regional.js"
export default {
namespaced: true,
state: {
last_id: -1,
act: 'new',
lookup_regional: 0,
lookup_error_message: '',
regionals: [],
total_regionals: 0,
total_filter_regionals: 0,
selected_regional: {
name: ""
},
save_status: 0,
save_error_message: '',
dialog_form_regional: false,
dialog_edit_form_regional: false,
alert_success: false,
msg_success: "",
show_all: 'N',
errors: [],
regionaltypes: [],
regionaltype: {},
doctors: [],
doctor: {},
get_data_status: 0,
get_data_error_message: '',
cities: [],
branch_address: {},
autocomplete_status: 0,
search_status: 0,
districts: [],
district_address: {},
kelurahans: [],
kelurahan_address: {},
instruments: [],
instrument: {},
autotemplates: [],
autotemplate: {},
nonlabs: [],
selected_nonlab: {},
current_page:1,
x_search: ''
},
mutations: {
update_x_search(state, val) {
state.x_search = val
},
update_current_page(state, val) {
state.current_page = val
},
update_last_id(state, val) {
state.last_id = val
},
update_act(state, val) {
state.act = val
},
update_errors(state, val) {
state.errors = val
},
update_show_all(state, val) {
state.show_all = val
},
update_lookup_error_message(state, status) {
state.lookup_error_message = status
},
update_lookup_regional(state, status) {
state.lookup_regional = status
},
update_regionals(state, data) {
state.regionals = data.records
state.total_regionals = data.total
state.total_filter_regionals = data.total_filter
},
update_selected_regional(state, val) {
state.selected_regional = val
},
update_save_status(state, val) {
state.save_status = val
},
update_save_error_message(state, val) {
state.save_error_message = val
},
update_dialog_form_regional(state, val) {
state.dialog_form_regional = val
},
update_dialog_edit_form_regional(state, val) {
state.dialog_edit_form_regional = val
},
update_alert_success(state, val) {
state.alert_success = val
},
update_msg_success(state, val) {
state.msg_success = val
},
update_regionaltypes(state, data) {
state.regionaltypes = data
},
update_regionaltype(state, val) {
state.regionaltype = val
},
update_doctors(state, data) {
state.doctors = data
},
update_doctor(state, val) {
state.doctor = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_get_data_error_message(state, val) {
state.get_data_error_message = val
},
update_cities(state, val) {
state.cities = val
},
update_branch_address(state, val) {
state.branch_address = val
},
update_autocomplete_status(state, val) {
state.autocomplete_status = val
},
update_districts(state, val) {
state.districts = val
},
update_district_address(state, val) {
state.district_address = val
},
update_kelurahans(state, val) {
state.kelurahans = val
},
update_kelurahan_address(state, val) {
state.kelurahan_address = val
},
update_instruments(state, data) {
state.instruments = data
},
update_instrument(state, val) {
state.instrument = val
},
update_autotemplates(state, data) {
state.autotemplates = data
},
update_autotemplate(state, val) {
state.autotemplate = val
},
update_nonlabs(state, val) {
state.nonlabs = val
},
update_selected_nonlab(state, val) {
state.selected_nonlab = val
}
},
actions: {
async lookup(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookup(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbybranch(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbybranch(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbydistrict(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbydistrict(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbykelurahan(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbykelurahan(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async lookupbyname(context, prm) {
context.commit("update_lookup_regional", 1)
try {
prm.token = one_token()
let resp = await api.lookupbyname(prm)
if (resp.status != "OK") {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_regional", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total,
total_filter: resp.data.total_filter
}
context.commit("update_regionals", data)
var pat = data.records[0]
if(prm.regional != ""){
context.commit("branch/update_autoregionals", [{
S_RegionalID: pat.S_RegionalID,
S_RegionalName: pat.S_RegionalName
}], { root: true })
context.commit("branch/update_autoregional", {
S_RegionalID: pat.S_RegionalID,
S_RegionalName: pat.S_RegionalName
},{ root: true })
}
}
} catch (e) {
context.commit("update_lookup_regional", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async save(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_save_error_message", resp.message)
var data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_errors", [])
context.commit("update_alert_success", true)
context.commit("update_dialog_form_regional", false)
var msg =" Regional " + prm.name + " sudah tersimpan dong ..."
context.commit("update_msg_success", msg)
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
} else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async update(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.update(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_save_error_message", resp.message)
let data = {
records: resp.data.records,
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_alert_success", true)
context.commit("update_dialog_form_regional", false)
var msg = " Regional " + prm.name + " sudah terupdate dong ..."
context.commit("update_msg_success", msg)
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
}else {
context.commit("update_errors", resp.data.errors)
}
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async delete(context, prm) {
context.commit("update_save_status", 1)
try {
let resp = await api.xdelete(one_token(), prm.regionalid)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_alert_success", true)
var msg = " Regional " + prm.name + " sudah dihapus dong"
context.commit("update_msg_success", msg)
context.commit("update_alert_success", true)
context.commit("update_selected_regional", {})
context.dispatch("lookupbyname", {
regional: prm.sregional,
branch: prm.sbranch,
district: prm.sdistrict,
kelurahan: prm.skelurahan,
current_page: 1,
lastid: -1
})
}
} catch (e) {
context.commit("update_save_status", 3)
console.log(e)
}
},
async selectnonlab(context) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.selectnonlab(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_nonlabs", resp.data.records.nonlabs)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
},
async selectdoctor(context) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.selectdoctor(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", resp.message)
} else {
context.commit("update_get_data_status", 2)
context.commit("update_get_data_error_message", "")
context.commit("update_doctors", resp.data.records.doctors)
}
} catch (e) {
context.commit("update_get_data_status", 3)
context.commit("update_get_data_error_message", e.message)
console.log(e)
}
},
async searchbranch(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchbranch(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_cities", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchdoctor(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchdoctor(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_doctors", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchinstrument(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchinstrument(one_token(), prm.tes)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_instruments", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchtemplate(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchtemplate(one_token(), prm.tes)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_autotemplates", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async getdistrict(context, prm) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getdistrict(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_districts", resp.data.records)
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
},
async getkelurahan(context, prm) {
context.commit("update_get_data_status", 1)
try {
let resp = await api.getkelurahan(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_kelurahans", resp.data.records)
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
}
}
}

View File

@@ -0,0 +1,25 @@
// State
// data ...
// Mutations
//
//
// Actions
import regional from "./modules/regional.js";
import branch from "./modules/branch.js";
import system from "../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
regional: regional,
branch: branch,
system:system
},
state: {
},
mutations: {
},
actions: {
}
});

View File

@@ -0,0 +1,40 @@
const URL = "/one-api/v1/regonline/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'subcategory/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 save(prm) {
try {
var resp = await axios.post(URL + 'subcategory/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
};
}
}

View File

@@ -0,0 +1,156 @@
const URL = "/one-api/v1/regonline/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'subcategory/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 selectcategory(token) {
try {
var resp = await axios.post(URL + 'subcategory/selectcategory',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function search_listing(prm) {
try {
var resp = await axios.post(URL + 'subcategory/search_listing',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 + 'subcategory/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 savejpagroup(prm) {
try {
var resp = await axios.post(URL + 'subcategory/savejpagroup',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 savelistingjpagroup(prm) {
try {
var resp = await axios.post(URL + 'subcategory/savelistingjpagroup',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(prm) {
try {
var resp = await axios.post(URL + 'subcategory/delete',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 savealljpadetail(prm) {
try {
var resp = await axios.post(URL + 'subcategory/savealljpadetail',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
};
}
}

View File

@@ -0,0 +1,238 @@
const URL = "/one-api/v1/regonline/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'subcategorytest/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 get_subgroups(prm) {
try {
var resp = await axios.post(URL + 'subcategorytest/get_subgroups', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function get_subsubgroups(prm) {
try {
var resp = await axios.post(URL + 'subcategorytest/get_subsubgroups', 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 getinitdatas(token) {
try {
var resp = await axios.post(URL + 'subcategorytest/getinitdatas',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getracks(prm) {
try {
var resp = await axios.post(URL + 'subcategorytest/getracks',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 + 'subcategorytest/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 checkbarcode(prm) {
try {
var resp = await axios.post(URL + 'subcategorytest/checkbarcode',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 searchunit(token,prm) {
try {
var resp = await axios.post(URL + 'subcategorytest/searchunit ',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdataselected(prm) {
try {
var resp = await axios.post(URL + 'subcategorytest/getdataselected ',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 doaddtest(prm) {
try {
var resp = await axios.post(URL + 'subcategorytest/doaddtest ',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 checkcodeexist(prm) {
try {
var resp = await axios.post(URL + 'subcategorytest/checkcodeexist ',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 searchsample(token,prm) {
try {
var resp = await axios.post(URL + 'subcategorytest/searchsample ',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,445 @@
<template>
<v-layout class="fill-height" column>
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>KATEGORI JADWAL & KUOTA</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn @click="openFormSubCategory(0)" icon>
<v-icon>library_add</v-icon>
</v-btn>
</v-toolbar>
<v-snackbar v-model="snackbar">
{{ msg_snackbar }}
<v-btn color="pink" text @click="snackbar = false">
tutup
</v-btn>
</v-snackbar>
<v-card>
<v-layout row>
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="patients" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
{{props.item.T_SubCategoryName}}
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
{{props.item.ispcr}}
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
{{props.item.isschedule}}
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
{{props.item.iskuota}}
</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<v-icon small class="ml-3" color="primary" @click="editFormSubgroup(props.item)">edit</v-icon>
<!-- <v-icon small class="ml-3" color="error" @click="deleteFormSubgroup(props.item)">clear</v-icon> -->
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-card>
<template>
<v-layout row justify-center>
<v-dialog v-model="dialogsubgroup" persistent max-width="750px">
<v-card>
<v-card-title>
<span class="headline">FORM KATEGORI</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-form ref="formsubgroupsubgroup" v-model="validsubgroup" lazy-validation>
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="xname" label="Nama*" :rules="xnameRules" required></v-text-field>
</v-flex>
<v-flex xs12>
<v-checkbox v-model="ispcr" label="Sebagai PCR ?"></v-checkbox>
</v-flex>
<v-flex xs12>
<v-checkbox v-model="isschedule" label="Ada Jadwal ?"></v-checkbox>
</v-flex>
<v-flex xs12>
<v-checkbox v-model="iskuota" label="Ada Kuota ?"></v-checkbox>
</v-flex>
<v-flex>
<p v-for="(xerror,idx) in xerrors" class="error pl-2 pr-2" style="color:#fff">{{xerror.msg}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="updateDialogFormSubgroup()">Tutup</v-btn>
<v-btn color="blue darken-1" flat @click="saveFormSubgroup()">Simpan</v-btn>
</v-card-actions>
</v-form>
</v-card>
</v-dialog>
</v-layout>
</template>
<template>
<v-dialog v-model="dialogdeletealertsubgroup" max-width="30%">
<v-card>
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
Peringatan !
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 xs12>
{{msgalertsubgroup}}
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialogdeletealertsubgroup = false">
Tutup
</v-btn>
<v-btn color="primary" flat @click="closeDeleteAlertSubgroup()">
Yakin lah
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
components: {
'one-dialog-info': httpVueLoader('../../../common/oneDialogInfo.vue'),
'one-dialog-alert': httpVueLoader('../../../common/oneDialogAlert.vue'),
'one-x-check': httpVueLoader('../../../common/onexcheck.vue')
},
mounted() {
this.$store.dispatch("samplesend/search", {
lastid: -1
})
this.$store.dispatch("samplesend/selectcategory")
},
methods: {
isSelected(p) {
return p.T_SubCategoryID == this.$store.state.samplesend.selected_patient.T_SubCategoryID
},
searchPatient() {
this.$store.dispatch("samplesend/search", {
lastid: -1
})
},
selectMe(pat) {
var patients = this.$store.state.samplesend.patients
this.$store.commit("samplesend/update_selected_patient", pat)
var idx = _.findIndex(patients, function (o) {
return o.Nat_JpaID == pat.Nat_JpaID && o.T_SubCategoryID == pat.T_SubCategoryID
})
this.$store.commit("samplesend/update_last_id", idx)
this.$store.dispatch("samplestorage/search", {
code: this.$store.state.samplestorage.code,
name: this.$store.state.samplestorage.name,
status: this.$store.state.samplestorage.selected_status.id,
jpagroup: pat.T_SubCategoryID,
current_page: 1,
lastid: -1
})
},
openFormSubCategory(val) {
this.xid = val
this.xname = ''
this.ispcr = false
this.isschedule = false
this.iskuota = false
this.$store.commit("samplesend/update_dialog_form_subgroup", true)
},
editFormSubgroup(val) {
this.xid = val.id
this.xname = val.T_SubCategoryName
this.ispcr = val.T_SubCategoryIsPCR === 'N' ? false : true
this.isschedule = val.T_SubCategoryIsSchedule === 'N' ? false : true
this.iskuota = val.T_SubCategoryIsKuota === 'N' ? false : true
this.$store.commit("samplesend/update_dialog_form_subgroup", true)
},
updateDialogFormSubgroup() {
this.$store.commit("samplesend/update_dialog_form_subgroup", false)
},
saveFormSubgroup() {
if (this.$refs.formsubgroupsubgroup.validate()) {
if (this.in_saving) return;
this.in_saving = true;
this.$store.dispatch("samplesend/save", {
xid: this.xid,
name: this.xname,
ispcr: this.ispcr === true ? "Y" : "N",
isschedule: this.isschedule === true ? "Y" : "N",
iskuota: this.iskuota === true ? "Y" : "N"
})
}
},
deleteFormSubgroup(data) {
this.xid = data.id
this.msgalertsubgroup = "Yakin, mau hapus kategori ini?"
this.dialogdeletealertsubgroup = true
},
closeDeleteAlertSubgroup() {
this.$store.dispatch("samplesend/delete", {
xid: this.xid,
current_page: this.curr_page,
ssubgroup: this.xsearch
})
this.dialogdeletealertsubgroup = false
},
xedit(value) {
var patients = this.$store.state.samplesend.patients
var idx = _.findIndex(patients, function (o) {
return o.Nat_JpaID == pat.Nat_JpaID && o.T_SubCategoryID == pat.T_SubCategoryID
})
patients[idx].open_edit = 'Y'
this.$store.commit("samplesend/update_patients", patients)
},
saveEdit(value) {
var prm = value
this.$store.dispatch("samplesend/save", prm)
},
xdelete(value) {
var prm = {
id: value.Nat_JPADetailID,
status: 'N'
}
this.$store.dispatch("samplesend/save", prm)
},
insertNewJPA() {
var prm = {
id: 0,
value: this.new_jpa
}
this.$store.dispatch("samplesend/savejpagroup", prm)
},
saveJPAGroupNew() {
var prm = {
id: 0,
value: this.value_new_jpa_group
}
this.$store.dispatch("samplesend/savelistingjpagroup", prm)
},
openlisting() {
this.$store.commit("samplesend/update_dialog_jpa_group", true)
this.$store.dispatch("samplesend/search_listing", {})
},
saveEditJpaGroup(value, status) {
var prm = {
id: value.T_SubCategoryID,
name: value.T_SubCategoryName,
status: status
}
this.$store.dispatch("samplesend/saveEditJpaGroup", prm)
},
changeDetail(value) {
var details = this.$store.state.samplesend.patients
var idx = _.findIndex(details, function (o) {
return o.Nat_JpaID == value.Nat_JpaID && o.T_SubCategoryID == value.T_SubCategoryID
})
details[idx].Nat_JPADetailDiscount = value.Nat_JPADetailDiscount
this.$store.commit("samplesend/update_patients", details)
},
savedetail() {
var prm = {
details: this.$store.state.samplesend.patients
}
this.$store.dispatch("samplesend/savealljpadetail", prm)
},
changejpagroupinlist(value) {
var details = this.$store.state.samplesend.jpa_groups
var idx = _.findIndex(details, function (o) {
return o.T_SubCategoryID == value.T_SubCategoryID
})
details[idx].T_SubCategoryName = value.T_SubCategoryName
this.$store.commit("samplesend/update_jpa_groups", details)
}
},
computed: {
snackbar: {
get() {
return this.$store.state.samplecall.alert_success
},
set(val) {
this.$store.commit("samplecall/update_alert_success", val)
}
},
jpagroups() {
return this.$store.state.samplesend.jpa_groups
},
value_new_jpa_group: {
get() {
return this.$store.state.samplesend.value_new_jpa_group
},
set(val) {
this.$store.commit("samplesend/update_value_new_jpa_group", val)
}
},
dialogjpagrup: {
get() {
return this.$store.state.samplesend.dialog_jpa_group
},
set(val) {
this.$store.commit("samplesend/update_dialog_jpa_group", val)
}
},
in_saving: {
get() {
return this.$store.state.samplesend.in_saving
},
set(val) {
this.$store.commit("samplesend/update_in_saving", val)
}
},
snackbar: {
get() {
return this.$store.state.samplesend.alert_success
},
set(val) {
this.$store.commit("samplesend/update_alert_success", val)
}
},
msg_snackbar: {
get() {
return this.$store.state.samplesend.msg_snackbar
},
set(val) {
this.$store.commit("samplesend/update_msg_snackbar", val)
}
},
isLoading() {
return this.$store.state.samplesend.search_status == 1
},
patients() {
return this.$store.state.samplesend.patients
},
xselectedpatient: {
get() {
return this.$store.state.samplesend.selected_patient
},
set(val) {
this.$store.commit("samplesend/update_selected_patient", val)
}
},
new_jpa: {
get() {
return this.$store.state.samplesend.new_jpa
},
set(val) {
this.$store.commit("samplesend/update_new_jpa", val)
}
},
xerrors() {
return this.$store.state.samplesend.errors
},
dialogsubgroup() {
return this.$store.state.samplesend.dialog_form_subgroup
},
xcategorys() {
return this.$store.state.samplesend.categorys
},
xcategory: {
get() {
return this.$store.state.samplesend.category
},
set(val) {
this.$store.commit("samplesend/update_category", val)
}
},
},
data() {
return {
open_edit: false,
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
items: [],
page: 1,
ispcr: false,
iskuota: false,
isschedule: false,
xname: '',
xid: 0,
validsubgroup: false,
dialogdeletealertsubgroup: false,
msgalertsubgroup: "",
xnameRules: [
v => !!v || 'Nama harus diisi'
],
headers: [{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "50%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "PCR",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "JADWAL",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "KUOTA",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "mr",
width: "100%",
class: "pa-2 blue lighten-3 white--text"
}
]
}
}
}
</script>

View File

@@ -0,0 +1,329 @@
<template>
<div>
<v-dialog v-model="xdialogaction" persistent max-width="350">
<v-card>
<v-card-title color="warning" class="headline">Konfirmasi</v-card-title>
<v-card-text v-html="xmsgaction">
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary darken-1" flat @click="closeDialogAction()">OK</v-btn>
<v-btn color="error darken-1" flat @click="xdialogaction = false">Tutup</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-layout wrap>
<v-flex xs12>
<v-card color="light-blue">
<v-layout align-center justify-center row shrink fill-height>
<v-flex xs2>
<v-img
:src="xselected_patient.M_PatientPhotoThumb"
:lazy-src="xselected_patient.M_PatientPhotoThumb"
aspect-ratio="1"
width="100%"
class="light-blue"
contain
>
</v-flex>
<v-flex xs10>
<v-card tile flat elevation="1">
<v-layout pt-1 pl-2 pb-1 pr-2 row>
<v-flex>
<v-subheader style="color:black;height:auto;padding:0px">
<h3 style="font-size:x-large" class="font-weight-bold">{{ xselected_patient.T_OrderHeaderLabNumber }}</h3>
<v-flex text-md-right>
<span @click="callPatient()" v-if="xselected_patient.statusid === '0' || xselected_patient.statusid === '2'" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text info"><v-icon dark>volume_up</v-icon></span>
<span @click="skip()" v-if="xselected_patient.statusid === '1' || xselected_patient.statusid === '3'" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text black"><v-icon dark>fast_rewind</v-icon></span>
<span @click="processNow(xselected_patient.statusid)" v-if="xselected_patient.statusid === '1'" v-bind:class="{ 'warning':xselected_patient.statusid === '1','grey':xselected_patient.statusid !== '1' }" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text"><v-icon dark>loop</v-icon></span>
</v-flex>
</v-subheader>
</v-flex>
</v-layout>
<v-layout pl-2 pr-2 row>
<v-flex xs4>
<v-layout column>
<v-flex pt-1>
<v-text-field
v-model=" xselected_patient.M_PatientNoReg"
label="PID"
readonly
hide-details
>
</v-text-field>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs8 pl-2>
<v-layout column>
<v-flex pt-1 >
<v-layout row>
<v-flex xs4>
<v-text-field
v-model="xselected_patient.patient_dob"
label="Tanggal lahir"
readonly
hide-details
>
</v-text-field>
</v-flex>
<v-flex xs8 pl-1>
<v-text-field
v-model=" xselected_patient.T_OrderHeaderM_PatientAge"
label="Umur"
readonly
hide-details
>
</v-text-field>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-layout pb-2 pt-1 pl-2 pr-2 row>
<v-flex xs8>
<v-text-field
v-model=" xselected_patient.patient_fullname"
label="Nama"
readonly
hide-details
>
</v-text-field>
</v-flex>
<v-flex xs4 pl-1>
<v-text-field
v-model="xselected_patient.M_PatientHP"
label="HP"
readonly
hide-details
>
</v-text-field>
</v-flex>
</v-layout>
</v-card>
</v-flex>
</v-layout>
</v-card>
</v-flex>
</v-layout>
<!--<v-card v-if="xselected_patient">
<v-layout row>
<v-flex xs12 pa-2>
<v-layout align-center row>
<v-flex xs2>
<v-card>
<v-img
:src="xselected_patient.M_PatientPhotoThumb"
aspect-ratio="1"
class="grey lighten-2 elevation-2"
>
</v-img>
</v-card>
</v-flex>
<v-flex xs10 pl-2 pt-1>
<v-card>
<v-layout pa-2 row>
<v-flex>
<v-subheader style="color:black;height:auto;padding:0px">
<h3 style="font-size:x-large" class="font-weight-bold">{{ xselected_patient.T_OrderHeaderLabNumber }}</h3>
<v-flex text-md-right>
<span @click="callPatient()" v-if="xselected_patient.statusid === '0' || xselected_patient.statusid === '2'" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text info"><v-icon dark>volume_up</v-icon></span>
<span @click="skip()" v-if="xselected_patient.statusid === '1' || xselected_patient.statusid === '3'" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text black"><v-icon dark>fast_rewind</v-icon></span>
<span @click="processNow(xselected_patient.statusid)" v-if="xselected_patient.statusid === '1'" v-bind:class="{ 'warning':xselected_patient.statusid === '1','grey':xselected_patient.statusid !== '1' }" style="font-size:24px;" class="icon-medium-fill-base-small xs1 white--text"><v-icon dark>loop</v-icon></span>
</v-flex>
</v-subheader>
</v-flex>
</v-layout>
<v-layout pa-2 row wrap>
<v-flex xs4>
<v-layout column>
<v-flex pt-1>
<v-text-field
v-model=" xselected_patient.M_PatientNoReg"
label="PID"
readonly
hide-details
>
</v-text-field>
</v-flex>
<v-flex pt-1 >
<v-text-field
v-model=" xselected_patient.patient_fullname"
label="Nama"
readonly
hide-details
>
</v-text-field>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs8 pl-2>
<v-layout column>
<v-flex pt-1 >
<v-layout row>
<v-flex xs4>
<v-text-field
v-model="xselected_patient.patient_dob"
label="Tanggal lahir"
readonly
hide-details
>
</v-text-field>
</v-flex>
<v-flex xs8 pl-1>
<v-text-field
v-model=" xselected_patient.T_OrderHeaderM_PatientAge"
label="Umur"
readonly
hide-details
>
</v-text-field>
</v-flex>
</v-layout>
</v-flex>
<v-flex pt-1>
<v-text-field
v-model="xselected_patient.M_PatientHP"
label="HP"
readonly
hide-details
>
</v-text-field>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-card>
</v-flex>
</v-layout>
</v-flex>
</v-layout> -->
</div>
</template>
<style scoped>
</style>
<script>
module.exports = {
data: () => ({
}),
computed: {
xselected_patient:{
get() {
return this.$store.state.samplecall.selected_patient
},
set(val) {
this.$store.commit("samplecall/update_selected_patient",val)
}
},
xdialogaction:{
get() {
return this.$store.state.samplecall.dialog_action
},
set(val) {
this.$store.commit("samplecall/update_dialog_action",val)
}
},
xmsgaction:{
get() {
return this.$store.state.samplecall.msg_action
},
set(val) {
this.$store.commit("samplecall/update_msg_action",val)
}
}
},
methods : {
closeDialogAction(){
var act = this.$store.state.samplecall.act
var sample = this.$store.state.samplecall.selected_sampletype
var status = 1
if(act === 'process'){
status = 3
}
if(act === 'skip'){
status = 2
}
if(act === 'samplingprocess'){
status = 3
}
if(act === 'samplingdone'){
status = 4
}
var patient = this.$store.state.samplecall.selected_patient
var lastid = this.$store.state.samplecall.last_id
this.$store.dispatch("samplecall/doaction",{
act:act,
id:patient.T_OrderHeaderID,
name:this.name,
nolab:this.nolab,
stationid: patient.T_SampleStationID,
statusid:this.$store.state.samplecall.selected_status.id,
statusnextid : status,
sample:sample,
lastid:lastid,
staff:this.$store.state.samplecall.staff
})
},
callPatient(){
//var patient = this.$store.state.samplecall.selected_patient
//var msg = "Anda yakin akan melakukan panggilan kepada pasien "+patient.patient_fullname+" ? "
//this.$store.commit("samplecall/update_msg_action",msg)
this.$store.commit("samplecall/update_act",'call')
this.closeDialogAction()
//this.$store.commit("samplecall/update_dialog_action",true)
},
processNow(value){
if(value === '1'){
//var patient = this.$store.state.samplecall.selected_patient
//var msg = "Anda yakin akan merubah status <span style='color:ff5252;font-weight:bold'>PROCESS</span> untuk pasien "+patient.patient_fullname+" ? "
//this.$store.commit("samplecall/update_msg_action",msg)
this.$store.commit("samplecall/update_act",'process')
this.closeDialogAction()
//this.$store.commit("samplecall/update_dialog_action",true)
}
},
skip(){
//var patient = this.$store.state.samplecall.selected_patient
//var msg = "Anda yakin akan merubah status <span style='color:ff5252;font-weight:bold'>SKIP</span> untuk pasien "+patient.patient_fullname+" ? "
//this.$store.commit("samplecall/update_msg_action",msg)
this.$store.commit("samplecall/update_act",'skip')
this.closeDialogAction()
//this.$store.commit("samplecall/update_dialog_action",true)
},
patient_photo(){
var photo = "https://www.sgm-inc.com/wp-content/uploads/2014/06/no-profile-male-img.gif"
if(this.xselected_patient.M_PatientPhoto){
photo = this.xselected_patient.M_PatientPhoto
}
console.log(photo)
return photo
}
}
}
</script>

View File

@@ -0,0 +1,193 @@
<template>
<v-layout class="fill-height" column>
<v-card class="mb-2 pa-2 searchbox">
<v-layout align-center row>
<v-flex xs4>
<v-text-field class="ma-1" style="font-size:14px" label="JPA BARU" outline v-model="new_jpa" hide-details></v-text-field>
</v-flex>
<v-flex xs2>
<span title="tambahkan jpa baru" v-if="new_jpa !== ''" @click="insertNewJPA()" class="icon-medium-fill-base primary"><v-icon dark>add</v-icon></span>
</v-flex>
</v-layout>
</v-card>
<v-card>
<v-layout row>
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="patients" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<span v-if="props.item.open_edit === 'N'">{{ props.item.Nat_JpaName }}</span>
<v-text-field v-if="props.item.open_edit === 'Y'" class="ma-1" style="font-size:14px" single-line @change="changejpa(props.item)"
v-model="props.item.Nat_JpaName" hide-details></v-text-field>
</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<div>
<span title="simpan" v-if="props.item.open_edit === 'Y'" @click="saveEdit(props.item)" class="icon-medium-fill-base-small info"><v-icon dark>save</v-icon></span>
<span v-if="props.item.open_edit === 'N'" title="edit" @click="xedit(props.item)" class="icon-medium-fill-base-small info"><v-icon dark>edit</v-icon></span>
<span v-if="props.item.open_edit === 'N'" title="hapus" @click="xdelete(props.item)" class="icon-medium-fill-base-small red"><v-icon dark>delete</v-icon></span>
</div>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-card>
<!--<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>-->
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
components: {
'one-dialog-info': httpVueLoader('../../../common/oneDialogInfo.vue'),
'one-dialog-alert': httpVueLoader('../../../common/oneDialogAlert.vue'),
'one-x-check': httpVueLoader('../../../common/onexcheck.vue')
},
mounted() {
this.$store.dispatch("samplecall/search", {
lastid: -1
})
},
methods: {
isSelected(p) {
return p.Nat_JpaID == this.$store.state.samplecall.selected_patient.Nat_JpaID
},
searchPatient() {
this.$store.dispatch("samplecall/search", {
lastid: -1
})
},
selectMe(pat) {
var patients = this.$store.state.samplecall.patients
this.$store.commit("samplecall/update_selected_patient", pat)
var idx = _.findIndex(patients, function (o) {
return o.Nat_JpaID == pat.Nat_JpaID
})
this.$store.commit("samplecall/update_last_id", idx)
this.$store.dispatch("samplesend/search", pat)
},
xedit(value) {
var patients = this.$store.state.samplecall.patients
var idx = _.findIndex(patients, function (o) {
return o.Nat_JpaID == value.Nat_JpaID
})
patients[idx].open_edit = 'Y'
this.$store.commit("samplecall/update_patients", patients)
},
saveEdit(value) {
var patients = this.$store.state.samplecall.patients
var idx = _.findIndex(patients, function (o) {
return o.Nat_JpaID == value.Nat_JpaID
})
patients[idx].open_edit = 'N'
patients[idx].Nat_JpaName = value.Nat_JpaName
var prm = patients[idx]
prm.status = 'Y'
prm.id = patients[idx].Nat_JpaID
this.$store.dispatch("samplecall/save", prm)
},
xdelete(value) {
var prm = {
id: value.Nat_JpaID,
value: value.Nat_JpaName,
status: 'N'
}
this.$store.dispatch("samplecall/save", prm)
},
insertNewJPA() {
var prm = {
id: 0,
value: this.new_jpa
}
this.$store.dispatch("samplecall/save", prm)
},
changejpa(value) {
var patients = this.$store.state.samplecall.patients
var idx = _.findIndex(patients, function (o) {
return o.Nat_JpaID == value.Nat_JpaID
})
patients[idx].open_edit = 'Y'
patients[idx].Nat_JpaName = value.Nat_JpaName
this.$store.commit("samplecall/update_patients", patients)
}
},
computed: {
snackbar: {
get() {
return this.$store.state.samplecall.alert_success
},
set(val) {
this.$store.commit("samplecall/update_alert_success", val)
}
},
isLoading() {
return this.$store.state.samplecall.search_status == 1
},
patients() {
return this.$store.state.samplecall.patients
},
xselectedpatient: {
get() {
return this.$store.state.samplecall.selected_patient
},
set(val) {
this.$store.commit("samplecall/update_selected_patient", val)
}
},
new_jpa: {
get() {
return this.$store.state.samplecall.new_jpa
},
set(val) {
this.$store.commit("samplecall/update_new_jpa", val)
}
},
},
data() {
return {
open_edit: false,
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
items: [],
page: 1,
headers: [{
text: "JPA",
align: "left",
sortable: false,
value: "mr",
width: "80%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "center",
sortable: false,
value: "status",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
}
]
};
}
}
</script>

View File

@@ -0,0 +1,649 @@
<template>
<v-layout class="fill-height" column>
<v-dialog v-model="dialogsuccess" persistent max-width="290">
<v-card>
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
<v-card-text>
{{msgsuccess}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card class="mb-2 pa-2 searchbox">
<v-layout>
<v-text-field class="xs3 pr-1" v-model="code" label="Kode" outline hide-details></v-text-field>
<v-text-field class="xs3 pr-1" v-model="name" label="Nama" outline hide-details></v-text-field>
<v-select class="mini-select xs3 pr-1" :items="xstatuses" item-text="name" return-object v-model="xselectedstatus" label="Status"
outline hide-details></v-select>
<span @click="searchTransaction" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span>
<!--<span @click="openprintformat" class="icon-medium-fill-base xs1 white--text grey darken-1 ml-1 icon-print"></span>-->
<!--<span @click="openform" class="icon-medium-fill-base xs1 white--text primary ml-1 icon-add"></span>-->
</v-layout>
</v-card>
<v-card>
<v-layout row>
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="xtransactions" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_TestSasCode }}</td>
<td class="text-xs-left pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.T_TestName}}</td>
<td class="text-xs-center pa-1" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
<div>
<v-btn @click="changeBtnFlag(props.item)" v-if="props.item.status === 'N'" small color="error">
<v-icon left>close</v-icon> Belum dipilih</v-btn>
<v-btn @click="changeBtnFlag(props.item)" v-if="props.item.status === 'Y'" small color="success">
<v-icon left>check</v-icon> Sudah terpilih</v-btn>
</div>
</td>
</template>
</v-data-table>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
</v-flex>
</v-layout>
</v-card>
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()"
@close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
<one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprint" :urlprint="urlprint" @close-dialog-print="closePrint"></one-dialog-print>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
components: {
'one-dialog-info': httpVueLoader('../../../common/oneDialogInfo.vue'),
'one-dialog-alert': httpVueLoader('../../../common/oneDialogAlert.vue'),
'one-dialog-print': httpVueLoader('../../../common/oneDialogPrintX.vue')
},
mounted() {
// this.$store.dispatch("samplestorage/getinitdatas")
/*this.$store.dispatch("samplestorage/search",{
code:this.code,
name: this.name,
status:this.xselectedstatus.id,
jpagroup:this.$store.state.samplesend.selected_patient.T_SubCategoryID,
current_page:1,
lastid:-1
})*/
},
methods: {
checkError(value) {
var errors = this.$store.state.samplestorage.errors
if (errors.includes(value)) {
return true
} else {
return false
}
},
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')}`
},
isSelected(p) {
return p.T_TestID == this.$store.state.samplestorage.selected_transaction.T_TestID
},
searchTransaction() {
this.$store.commit("samplestorage/update_current_page", 1)
this.$store.dispatch("samplestorage/search", {
code: this.code,
name: this.name,
status: this.xselectedstatus.id,
jpagroup: this.$store.state.samplesend.selected_patient.T_SubCategoryID,
current_page: 1,
lastid: -1
})
},
selectMe(trx) {
if (this.$store.state.samplestorage.no_save == 0) {
console.log(trx)
this.$store.commit("samplestorage/update_selected_transaction", trx)
this.$store.commit("samplestorage/update_act", 'edit')
} else {
this.$store.commit("samplestorage/update_open_alert_confirmation", true)
}
},
closeAlertConfirmation() {
this.$store.commit("samplestorage/update_open_alert_confirmation", false)
},
forgetAlertConfirmation() {
this.$store.commit("samplestorage/update_no_save", 0)
this.$store.commit("samplestorage/update_open_alert_confirmation", false)
},
updateAlert_success(val) {
this.$store.commit("samplestorage/update_alert_success", val)
},
setNewTransaction() {
this.$store.commit("samplestorage/update_selected_transaction", {})
this.$store.commit("samplestorage/update_act", 'new')
this.$store.commit("form/update_transaction_number", "")
this.$store.commit("form/update_transaction_date", moment(new Date()).format('DD-MM-YYYY'))
this.$store.commit("form/update_transaction_time", moment(new Date()).format("hh:mm"))
this.$store.commit("form/update_transaction_note", '')
this.$store.commit("form/update_details", [])
},
closeDialogSuccess() {
let arrtrx = this.$store.state.samplestorage.transactions
var idx = _.findIndex(arrtrx, item => item.T_SampleStorageID === this.$store.state.samplestorage.last_id)
console.log(idx)
this.$store.dispatch("samplestorage/search", {
code: this.code,
name: this.name,
current_page: 1,
lastid: idx
})
this.$store.commit("samplestorage/update_dialog_success", false)
},
closeDialogInfo() {
this.$store.commit("samplestorage/update_open_dialog_info", false)
},
changeBtnFlag(value) {
if (this.in_saving) return;
this.in_saving = true;
var newval = value.status === 'N' ? 'Y' : 'N'
var prm = value
prm.status = newval
prm.jpagroupid = this.$store.state.samplesend.selected_patient.T_SubCategoryID
prm.paramsearch = {
code: this.code,
name: this.name,
status: this.xselectedstatus.id,
jpagroup: this.$store.state.samplesend.selected_patient.T_SubCategoryID,
current_page: this.curr_page,
lastid: -1
}
this.$store.dispatch("samplestorage/save", prm)
},
openform() {
this.$store.commit("samplestorage/update_errors", [])
this.$store.commit("samplestorage/update_act", 'new')
this.$store.commit("samplestorage/update_code_exist", 'N')
this.$store.commit("samplestorage/update_subgroups", [])
this.$store.commit("samplestorage/update_subsubgroups", [])
this.$store.commit("samplestorage/update_units", [])
this.$store.commit("samplestorage/update_samples", [])
var xform = {
code: '',
name: '',
shortname: '',
codebarcode: '',
worklistname: '',
xgroup: {},
subgroup: {},
subsubgroup: {},
type: {},
unit: {},
fontsize: '',
fontcolor: '',
flaggluc: '',
nonlab: {
id: "",
name: "LAB"
},
flagbold: 'N',
flagitalic: 'N',
flagquantitative: 'N',
deltacheck: 'N',
trendanalysis: 'N',
isresult: 'N',
isprice: 'N',
printresult: 'N',
printnote: 'N',
isworklist: 'N',
sample: {},
flaglow: '',
flaghigh: ''
}
this.$store.commit("samplestorage/update_xform", xform)
this.dialognew = true
},
openEdit(value) {
this.$store.commit("samplestorage/update_errors", [])
this.$store.commit("samplestorage/update_act", 'edit')
this.$store.commit("samplestorage/update_code_exist", 'N')
this.$store.commit("samplestorage/update_subgroups", [])
this.$store.commit("samplestorage/update_subsubgroups", [])
this.$store.commit("samplestorage/update_units", [])
this.$store.commit("samplestorage/update_samples", [])
this.$store.dispatch("samplestorage/getdataselected", value)
},
openprintformat() {
this.formatreport = 'pdf'
this.dialogchooseprint = true
},
doPrint() {
console.log('doprint')
this.dialogchooseprint = false
this.printwidth = 1028
this.printtitle = ""
let user = one_user()
var d = new Date();
var n = d.getTime()
var rptname = 'test_nasional'
var formatrpt = this.formatreport
this.urlprint = "/birt/run?__report=report/nasional/masterdata/" + rptname + ".rptdesign&__format=" +
formatrpt + "&username=" + user.M_UserUsername + "&tm=" + n
this.openprint = true
},
closePrint() {
this.openprint = false
},
saveData() {
this.$store.commit("samplestorage/update_errors", [])
var errors = this.$store.state.samplestorage.errors
if (this.$store.state.samplestorage.code_exist === 'Y' && this.$store.state.samplestorage.act ===
'new') {
errors.push("requirecodeexist")
}
if (this.xform.code === '') {
errors.push("requirecode")
}
if (this.xform.code.length !== 8) {
errors.push("requirecodedigit")
}
if (this.xform.name === '') {
errors.push("requirename")
}
if (_.isEmpty(this.xform.xgroup)) {
errors.push("requiregrup")
}
if (_.isEmpty(this.xform.subgroup)) {
errors.push("requiresubgrup")
}
if (_.isEmpty(this.xform.subsubgroup)) {
errors.push("requiresubsubgrup")
}
if (_.isEmpty(this.xform.type)) {
errors.push("requiretype")
}
if (_.isEmpty(this.xform.nonlab)) {
errors.push("requirenonlab")
}
if (this.xform.isresult === 'Y') {
if (_.isEmpty(this.xform.unit)) {
errors.push("requireunit")
}
if (_.isEmpty(this.xform.sample)) {
errors.push("requiresample")
}
}
if (errors.length === 0) {
var searchprm = {
code: this.code,
name: this.name,
current_page: 1,
lastid: -1
}
var prm = this.$store.state.samplestorage.xform
prm.paramsearch = searchprm
prm.act = this.$store.state.samplestorage.act
this.$store.dispatch("samplestorage/save", prm)
}
},
thr_search_unit: _.debounce(function () {
this.$store.dispatch("samplestorage/searchunit", this.search_unit)
}, 2000),
thr_search_sample: _.debounce(function () {
this.$store.dispatch("samplestorage/searchsample", this.search_sample)
}, 2000),
checkCodeExist(code) {
this.$store.dispatch("samplestorage/checkcodeexist", {
code: code
})
},
openAddTest(value) {
this.$store.commit("samplestorage/update_errors", [])
this.codefrom = value.T_TestCode
this.codetoward = this.$store.state.samplestoragesas.selected_transaction.T_TestSasCode
this.dialogaddtest = true
},
doAddTest() {
this.$store.commit("samplestorage/update_errors", [])
var errors = this.$store.state.samplestorage.errors
if (this.codetoward.length <= 8)
errors.push("lenghtcodetoward")
if (this.codetoward.length % 2 !== 0)
errors.push("falseformat")
console.log(errors)
if (errors.length === 0) {
this.dialogaddtest = false
var prm = {}
prm.codefrom = this.codefrom
prm.codetoward = this.codetoward
var searchprm = {
code: this.$store.state.samplestoragesas.xcode,
name: this.$store.state.samplestoragesas.xname,
current_page: this.$store.state.samplestoragesas.current_page,
lastid: -1
}
prm.paramsearch = searchprm
this.$store.dispatch("samplestorage/doaddtest", prm)
}
}
},
computed: {
xstatuses: {
get() {
return this.$store.state.samplestorage.statuses
},
set(val) {
this.$store.commit("samplestorage/update_statuses", val)
}
},
xselectedstatus: {
get() {
return this.$store.state.samplestorage.selected_status
},
set(val) {
this.$store.commit("samplestorage/update_selected_status", val)
}
},
dialognew: {
get() {
return this.$store.state.samplestorage.dialognew
},
set(val) {
this.$store.commit("samplestorage/update_dialognew", val)
}
},
in_saving: {
get() {
return this.$store.state.samplestorage.in_saving
},
set(val) {
this.$store.commit("samplestorage/update_in_saving", val)
}
},
code: {
get() {
return this.$store.state.samplestorage.code
},
set(val) {
this.$store.commit("samplestorage/update_code", val)
}
},
name: {
get() {
return this.$store.state.samplestorage.name
},
set(val) {
this.$store.commit("samplestorage/update_name", val)
}
},
dialogsuccess: {
get() {
return this.$store.state.samplestorage.dialog_success
},
set(val) {
this.$store.commit("samplestorage/update_dialog_success", val)
}
},
msgsuccess() {
return this.$store.state.samplestorage.msg_success
},
snackbar: {
get() {
return this.$store.state.samplestorage.alert_success
},
set(val) {
this.$store.commit("samplestorage/update_alert_success", val)
}
},
isLoading() {
return this.$store.state.samplestorage.search_status == 1
},
xact() {
return this.$store.state.samplestorage.act
},
xdatestart: {
get() {
return this.$store.state.samplestorage.start_date
},
set(val) {
this.$store.commit("samplestorage/update_start_date", val)
}
},
xdateend: {
get() {
return this.$store.state.samplestorage.end_date
},
set(val) {
this.$store.commit("samplestorage/update_end_date", val)
}
},
filterComputedDateFormattedStart() {
return this.formatDate(this.xdatestart)
},
filterComputedDateFormattedEnd() {
return this.formatDate(this.xdateend)
},
xtransactions() {
console.log(this.$store.state.samplestorage.transactions)
return this.$store.state.samplestorage.transactions
},
openalertconfirmation: {
get() {
return this.$store.state.samplestorage.open_alert_confirmation
},
set(val) {
this.$store.commit("samplestorage/update_open_alert_confirmation", val)
}
},
opendialoginfo: {
get() {
return this.$store.state.samplestorage.open_dialog_info
},
set(val) {
this.$store.commit("samplestorage/update_open_dialog_info", false)
}
},
msginfo() {
return this.$store.state.samplestorage.msg_info
},
curr_page: {
get() {
return this.$store.state.samplestorage.current_page
},
set(val) {
this.$store.commit("samplestorage/update_current_page", val)
this.$store.dispatch("samplestorage/search", {
code: this.code,
name: this.name,
status: this.xselectedstatus.id,
jpagroup: this.$store.state.samplesend.selected_patient.T_SubCategoryID,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.samplestorage.total_page
},
set(val) {
this.$store.commit("samplestorage/update_total_page", val)
}
},
xform: {
get() {
return this.$store.state.samplestorage.xform
},
set(val) {
this.$store.commit("samplestorage/update_xform", val)
}
},
groups: {
get() {
return this.$store.state.samplestorage.groups
},
set(val) {
this.$store.commit("samplestorage/update_groups", val)
}
},
subgroups: {
get() {
return this.$store.state.samplestorage.subgroups
},
set(val) {
this.$store.commit("samplestorage/update_subgroups", val)
}
},
subsubgroups: {
get() {
return this.$store.state.samplestorage.subsubgroups
},
set(val) {
this.$store.commit("samplestorage/update_subsubgroups", val)
}
},
types: {
get() {
return this.$store.state.samplestorage.types
},
set(val) {
this.$store.commit("samplestorage/update_types", val)
}
},
units: {
get() {
return this.$store.state.samplestorage.units
},
set(val) {
this.$store.commit("samplestorage/update_units", val)
}
},
nonlabs: {
get() {
return this.$store.state.samplestorage.nonlabs
},
set(val) {
this.$store.commit("samplestorage/update_nonlabs", val)
}
},
samples: {
get() {
return this.$store.state.samplestorage.samples
},
set(val) {
this.$store.commit("samplestorage/update_samples", val)
}
},
selected_group: {
get() {
return this.$store.state.samplestorage.xform.xgroup
},
set(val) {
this.xform.xgroup = val
this.$store.commit("samplestorage/update_xform", this.xform)
this.$store.dispatch("samplestorage/get_subgroups", val)
this.$store.dispatch("samplestorage/get_subsubgroups", val)
}
}
},
watch: {
search_unit(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.samplestorage.update_autocomplete_status == 1) return
this.thr_search_unit()
},
search_sample(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.samplestorage.update_autocomplete_status == 1) return
this.thr_search_sample()
}
},
data() {
return {
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
menufilterdatestart: false,
menufilterdateend: false,
date: new Date().toISOString().substr(0, 10),
items: [],
dialogaddtest: false,
codefrom: '',
codetoward: '',
dialogchooseprint: false,
openprint: false,
urlprint: '',
printtitle: '',
printwidth: 600,
formatreport: 'pdf',
page: 1,
search_unit: '',
search_sample: '',
headers: [{
text: "KODE",
align: "left",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
width: "25%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "center",
sortable: false,
width: "10%",
class: "pa-1 blue lighten-3 white--text"
}
],
pagination: {
descending: false,
page: 1,
rowsPerPage: 5,
sortBy: 'T_SampleStorageDate',
totalItems: this.$store.state.samplestorage.total_transactions
}
};
}
}
</script>

View File

@@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>One</title>
<link rel="stylesheet" href="../../libs/vendor/css/google-fonts.css">
<link rel="stylesheet" href="../../libs/vendor/css/icomoon-fonts.css">
<link rel="stylesheet" href="../../libs/vendor/css/vuetify.min.css">
</head>
<body v-on:key="doSomething">
<div v-cloak id="app">
<v-app id="smartApp" >
<one-navbar></one-navbar>
<v-content style="background:#F5E8DF!important" >
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
<v-layout row wrap >
<v-flex xs6 class="left" fill-height pa-1>
<one-sample-call-so-detail></one-sample-call-so-detail>
</v-flex>
<v-flex xs6 class="right" fill-height pa-1>
<!--<one-sample-call-so-info></one-sample-call-so-info>-->
<one-sample-call-so-list></one-sample-call-so-list>
</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/vendor/socket.io.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`
}
var socketIoUrl = "http://" + window.location.host + ":9090/";
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
data : {
socket : io.connect(socketIoUrl,{forceNew:false})
},
store,
el: '#app',
mounted(){
/*let self = this
this.socket.on("notification", function(msg) {
switch(msg.type) {
case "specimen-col-receive" :
self.$store.dispatch("samplecall/getstationstatus",{
name:self.$store.state.samplecall.name,
nolab: self.$store.state.samplecall.nolab,
sampletypeid: self.$store.state.samplecall.selected_filter_sampletype.id,
lastid: -1
})
self.$store.dispatch("samplecall/search",{
nolab:self.$store.state.samplecall.nolab,
sampletypeid: self.$store.state.samplecall.selected_filter_sampletype.id,
lastid: -1
})
break;
}
});
*/
},
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-sample-call-so-list': httpVueLoader('./components/oneSampleStorageList.vue'),
'one-sample-call-so-detail': httpVueLoader('./components/oneSampleCallSODetail.vue'),
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,155 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/samplecall.js"
export default {
namespaced: true,
state: {
last_id:-1,
last_saved_id:-1,
x_addr_id:0,
btn_hide:false,
act:'edit',
act_addr:'new',
get_data_status:0,
search_patient: 0,
search_status: 0,
search_error_message: '',
preffix:'',
patient_name:'',
suffix:'',
patients: [],
selected_patient: {},
save_status: 0,
btn_save_seen: true,
pgrs_save: false,
save_error_message: '',
no_save: 0,
new_jpa:'',
msg_snackbar:'',
alert_success:false
},
mutations: {
update_alert_success(state,val){
state.alert_success = val
},
update_msg_snackbar(state, val){
state.msg_snackbar = val
},
update_new_jpa(state, val) {
state.new_jpa = val
},
update_last_id(state, val) {
state.last_id = val
},
update_last_saved_id(state, val) {
state.last_saved_id = val
},
update_act(state, val) {
state.act = val
},
update_act_addr(state, val) {
state.act_addr = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_search_error_message(state, patient) {
state.search_error_message = patient
},
update_search_patient(state, patient) {
state.search_patient = patient
},
update_patients(state, data) {
state.patients = data
},
update_selected_patient(state, val) {
state.selected_patient = val
},
update_save_status(state, val) {
state.save_status = val
},
update_btn_save_seen(state, val) {
state.btn_save_seen = val
},
update_pgrs_save(state, val) {
state.pgrs_save = val
},
update_save_error_message(state, msg) {
state.save_error_message = ''
},
update_no_save(state, val) {
state.no_save = val
},
},
actions: {
async search(context, prm) {
context.commit("update_search_patient", 1)
try {
prm.token = one_token()
let resp = await api.search(prm)
if (resp.status != "OK") {
context.commit("update_search_patient", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_patient", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_patients", data.records)
context.commit("update_no_save", 0)
if(prm.lastid === -1){
var pat = data.records[0]
if(data.records.length === 0){
context.commit("update_selected_patient", {})
context.dispatch("samplesend/update_patients", [],{root:true})
}else{
console.log('aye')
context.commit("update_selected_patient", data.records[0])
context.dispatch("samplesend/search", data.records[0],{root:true})
}
}
else{
context.commit("update_selected_patient", data.records[prm.lastid])
context.dispatch("samplesend/search", data.records[prm.lastid],{root:true})
}
}
} catch (e) {
context.commit("update_search_patient", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async save(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_new_jpa",'')
var msg = ''
if(prm.id === 0)
msg = "JPA "+prm.value+" berhasil ditambahkan"
else{
if(prm.status === 'N')
msg = "JPA "+prm.value+" berhasil dihapus"
else
msg = "JPA diubah menjadi "+prm.Nat_JpaName
}
context.commit("samplesend/update_msg_snackbar",msg,{root:true})
context.commit("samplesend/update_alert_success",true,{root:true})
setInterval(function(){ context.commit("update_alert_success",false) }, 5000)
context.dispatch("search",{lastid:-1})
}
} catch(e) {
context.commit("update_save_status",3)
}
},
}
}

View File

@@ -0,0 +1,315 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/samplesend.js"
export default {
namespaced: true,
state: {
last_id:-1,
last_saved_id:-1,
x_addr_id:0,
btn_hide:false,
act:'edit',
act_addr:'new',
get_data_status:0,
search_patient: 0,
search_status: 0,
search_error_message: '',
preffix:'',
patient_name:'',
suffix:'',
patients: [],
selected_patient: {},
save_status: 0,
btn_save_seen: true,
pgrs_save: false,
save_error_message: '',
no_save: 0,
new_jpa:'',
value_new_jpa_group:'',
dialog_jpa_group:false,
jpa_groups:[],
msg_snackbar:'',
categorys: [],
category: {},
dialog_form_subgroup: false,
errors: [],
in_saving: false,
alert_success:false
},
mutations: {
update_in_saving(state, val) {
state.in_saving = val
},
update_errors(state, val) {
state.errors = val
},
update_dialog_form_subgroup(state, val) {
state.dialog_form_subgroup = val
},
update_categorys(state, data) {
state.categorys = data
},
update_category(state, val) {
state.category = val
},
update_alert_success(state,val){
state.alert_success = val
},
update_msg_snackbar(state, val){
state.msg_snackbar = val
},
update_jpa_groups(state, val){
state.jpa_groups = val
},
update_dialog_jpa_group(state, val){
state.dialog_jpa_group = val
},
update_value_new_jpa_group(state, val){
state.value_new_jpa_group = val
},
update_new_jpa(state, val) {
state.new_jpa = val
},
update_last_id(state, val) {
state.last_id = val
},
update_last_saved_id(state, val) {
state.last_saved_id = val
},
update_act(state, val) {
state.act = val
},
update_act_addr(state, val) {
state.act_addr = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_search_error_message(state, patient) {
state.search_error_message = patient
},
update_search_patient(state, patient) {
state.search_patient = patient
},
update_patients(state, data) {
state.patients = data
},
update_selected_patient(state, val) {
state.selected_patient = val
},
update_save_status(state, val) {
state.save_status = val
},
update_btn_save_seen(state, val) {
state.btn_save_seen = val
},
update_pgrs_save(state, val) {
state.pgrs_save = val
},
update_save_error_message(state, msg) {
state.save_error_message = ''
},
update_no_save(state, val) {
state.no_save = val
},
},
actions: {
async search(context, prm) {
context.commit("update_search_patient", 1)
try {
prm.token = one_token()
let resp = await api.search(prm)
if (resp.status != "OK") {
context.commit("update_search_patient", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_patient", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_patients", data.records)
context.commit("update_no_save", 0)
if(prm.lastid === -1){
var pat = data.records[0]
if(data.records.length === 0){
context.commit("update_selected_patient", {})
}else{
context.commit("update_selected_patient", data.records[0])
context.dispatch("samplestorage/search",{
code:context.rootState.samplestorage.code,
name: context.rootState.samplestorage.name,
status:context.rootState.samplestorage.selected_status.id,
jpagroup:data.records[0].T_SubCategoryID,
current_page:1,
lastid:-1
},{root:true})
}
}
else{
context.commit("update_selected_patient", data.records[prm.lastid])
context.dispatch("samplestorage/search",{
code:context.rootState.samplestorage.code,
name: context.rootState.samplestorage.name,
status:context.rootState.samplestorage.selected_status.id,
jpagroup:data.records[prm.lastid].T_SubCategoryID,
current_page:1,
lastid:-1
},{root:true})
}
}
} catch (e) {
context.commit("update_search_patient", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async search_listing(context, prm) {
//context.commit("update_search_patient", 1)
try {
prm.token = one_token()
let resp = await api.search_listing(prm)
if (resp.status != "OK") {
//context.commit("update_search_patient", 3)
context.commit("update_search_error_message", resp.message)
} else {
//context.commit("update_search_patient", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_jpa_groups", data.records)
}
} catch (e) {
//context.commit("update_search_patient", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async save(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_msg_snackbar","Sub Kategori berhasil ditambahkan")
context.commit("update_alert_success",true)
setInterval(function(){ context.commit("update_alert_success",false) }, 5000)
var xselpat = context.rootState.samplecall.selected_patient
xselpat.lastid = -1
context.dispatch("search",xselpat)
context.commit("update_dialog_form_subgroup",false)
context.commit("update_in_saving",false)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async delete(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.xdelete(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_msg_snackbar","Kategori berhasil dihapus")
context.commit("update_alert_success",true)
setInterval(function(){ context.commit("update_alert_success",false) }, 5000)
var xselpat = context.rootState.samplecall.selected_patient
xselpat.lastid = -1
context.dispatch("search",xselpat)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async savejpagroup(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.savejpagroup(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_msg_snackbar","JPA Grup berhasil ditambahkan")
context.commit("update_alert_success",true)
setInterval(function(){ context.commit("update_alert_success",false) }, 5000)
var xselpat = context.rootState.samplecall.selected_patient
xselpat.lastid = -1
context.dispatch("search",xselpat)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async saveEditJpaGroup(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.savelistingjpagroup(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.dispatch("search_listing",{})
if(prm.status === 'Y')
context.commit("update_msg_snackbar","Data telah diubah")
else
context.commit("update_msg_snackbar","Data telah dihapus")
context.commit("update_alert_success",true)
setInterval(function(){ context.commit("update_alert_success",false) }, 5000)
var xselpat = context.rootState.samplecall.selected_patient
xselpat.lastid = -1
context.dispatch("search",xselpat)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async selectcategory(context) {
context.commit("update_save_status", 1)
try {
let resp = await api.selectcategory(one_token())
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
context.commit("update_categorys", resp.data.records.categorys)
}
} catch (e) {
context.commit("update_save_status", 3)
console.log(e)
}
},
async savealljpadetail(context,prm) {
context.commit("update_save_status",1)
try {
console.log(prm)
prm.token = one_token()
let resp= await api.savealljpadetail(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_msg_snackbar","Data telah tersimpan")
context.commit("update_alert_success",true)
setInterval(function(){ context.commit("update_alert_success",false) }, 5000)
context.dispatch("search_listing",{})
}
} catch(e) {
context.commit("update_save_status",3)
}
},
}
}

View File

@@ -0,0 +1,473 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/samplestorage.js"
export default {
namespaced: true,
state: {
last_id:-1,
last_saved_id:-1,
x_addr_id:0,
act:'new',
act_addr:'new',
get_data_status:0,
search_trx: 0,
search_status: 0,
search_error_message: '',
start_date:moment(new Date()).format('YYYY-MM-DD'),
end_date:moment(new Date()).format('YYYY-MM-DD'),
total_transaction: 0,
transactions:[],
selected_transaction: {},
save_status: 0,
btn_save_seen: true,
pgrs_save: false,
save_error_message: '',
no_save: 0,
open_alert_confirmation:false,
alert_success: false,
msg_success: "",
dialog_success: false,
dialog_confirmation_delete: false,
msg_confirmation_delete: "",
autocomplete_status:0,
dialog_form_address: false,
errors:[],
open_dialog_info:false,
msg_info:'',
current_page:1,
total_page:1,
code:'',
name:'',
dialognew:false,
xform:{
code:'',
name:'',
shortname:'',
codebarcode:'',
worklistname:'',
xgroup:{},
subgroup:{},
subsubgroup:{},
type:{},
unit:{},
fontsize:'',
fontcolor:'',
flaggluc:'',
nonlab:{id:"",name:"LAB"},
flagbold:'N',
flagitalic:'N',
flagquantitative:'N',
deltacheck:'N',
trendanalysis:'N',
isresult:'N',
isprice:'N',
printresult:'N',
printnote:'N',
isworklist:'N',
sample:{},
flaglow:'',
flaghigh:''
},
groups:[],
subgroups:[],
subsubgroups:[],
types:[],
units:[],
nonlabs:[],
samples:[],
autocomplete_status:0,
code_exist:'N',
statuses:[{id:'Y',name:'sudah dipilih'},{id:'A',name:'semua'}],
selected_status:{id:'Y',name:'sudah dipilih'},
msg_snackbar:'',
in_saving: false,
alert_success:false
},
mutations: {
update_in_saving(state, val) {
state.in_saving = val
},
update_alert_success(state,val){
state.alert_success = val
},
update_msg_snackbar(state, val){
state.msg_snackbar = val
},
update_statuses(state, val) {
state.statuses = val
},
update_selected_status(state, val) {
state.selected_status = val
},
update_code_exist(state, val) {
state.code_exist = val
},
update_samples(state, val) {
state.samples = val
},
update_nonlabs(state, val) {
state.nonlabs = val
},
update_autocomplete_status(state, val) {
state.autocomplete_status = val
},
update_units(state, val) {
state.units = val
},
update_types(state, val) {
state.types = val
},
update_subgroups(state, val) {
state.subgroups = val
},
update_subsubgroups(state, val) {
state.subsubgroups = val
},
update_groups(state, val) {
state.groups = val
},
update_xform(state, val) {
state.xform = val
},
update_dialognew(state, val) {
state.dialognew = val
},
update_code(state, val) {
state.code = val
},
update_name(state, val) {
state.name = val
},
update_total_page(state, val) {
state.total_page = val
},
update_current_page(state, val) {
state.current_page = val
},
update_x_addr_id(state, val) {
state.x_addr_id = val
},
update_last_id(state, val) {
state.last_id = val
},
update_last_saved_id(state, val) {
state.last_saved_id = val
},
update_act(state, val) {
state.act = val
},
update_start_date(state, val) {
state.start_date = val
},
update_end_date(state, val) {
state.end_date = val
},
update_act_addr(state, val) {
state.act_addr = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_search_error_message(state, patient) {
state.search_error_message = patient
},
update_search_transaction(state, val) {
state.search_transaction = val
},
update_transactions(state, data) {
state.transactions = data
},
update_selected_transaction(state, val) {
state.selected_transaction = val
},
update_save_status(state, val) {
state.save_status = val
},
update_btn_save_seen(state, val) {
state.btn_save_seen = val
},
update_pgrs_save(state, val) {
state.pgrs_save = val
},
update_save_error_message(state, msg) {
state.save_error_message = ''
},
update_no_save(state, val) {
state.no_save = val
},
update_open_alert_confirmation(state, val) {
state.open_alert_confirmation = val
},
update_alert_success(state, val) {
state.alert_success = val
},
update_msg_success(state, val) {
state.msg_success = val
},
update_dialog_success(state, val) {
state.dialog_success = val
},
update_dialog_confirmation_delete(state, val) {
state.dialog_confirmation_delete = val
},
update_msg_confirmation_delete(state, val) {
state.msg_confirmation_delete = val
},
update_search_status(state, val) {
state.search_status = val
},
update_errors(state, val) {
state.errors = val
},
update_total_transactions(state, val) {
state.total_transactions = val
},
update_open_dialog_info(state, val) {
state.open_dialog_info = val
},
update_msg_info(state, val) {
state.msg_info = val
},
},
actions: {
async search(context, prm) {
context.commit("update_search_transaction", 1)
try {
prm.token = one_token()
let resp = await api.search(prm)
if (resp.status != "OK") {
context.commit("update_search_transaction", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_transaction", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_transactions", data.records)
context.commit("update_total_transactions", data.total)
context.commit("update_total_page", data.total)
context.commit("update_no_save", 0)
/*if(prm.lastid === -1){
context.commit("update_selected_transaction", data.records[0])
var doc = data.records[0]
}
else{
context.commit("update_selected_transaction", data.records[prm.lastid])
var doc = data.records[prm.lastid]
}*/
}
} catch (e) {
context.commit("update_search_transaction", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async getinitdatas(context) {
context.commit("update_get_data_status",1)
try {
let resp= await api.getinitdatas(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_groups",data.records.groups)
//context.commit("update_subgroups",data.records.subgroups)
context.commit("update_types",data.records.types)
context.commit("update_nonlabs",data.records.nonlabs)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async getdataselected(context,prm) {
context.commit("update_get_data_status",1)
try {
prm.token = one_token()
let resp= await api.getdataselected(prm)
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_xform",data.records.xform)
context.commit("update_subgroups",data.records.subgroups)
context.commit("update_subsubgroups",data.records.subsubgroups)
var units = []
units.push(data.records.xform.unit)
context.commit("update_units",units)
var samples = []
samples.push(data.records.xform.sample)
context.commit("update_samples",samples)
context.commit("update_dialognew",true)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async checkcodeexist(context,prm) {
context.commit("update_get_data_status",1)
try {
prm.token = one_token()
let resp= await api.checkcodeexist(prm)
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_code_exist",data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async get_subgroups(context,prm) {
context.commit("update_get_data_status",1)
try {
prm.token = one_token()
let resp= await api.get_subgroups(prm)
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_subgroups",data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async get_subsubgroups(context,prm) {
context.commit("update_get_data_status",1)
try {
prm.token = one_token()
let resp= await api.get_subsubgroups(prm)
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_subsubgroups",data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async searchunit(context,prm) {
context.commit("update_autocomplete_status",1)
try {
let resp= await api.searchunit(one_token(),prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status",3)
} else {
context.commit("update_autocomplete_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_units",resp.data.records)
}
} catch(e) {
context.commit("update_autocomplete_status",3)
}
},
async searchsample(context,prm) {
context.commit("update_autocomplete_status",1)
try {
let resp= await api.searchsample(one_token(),prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status",3)
} else {
context.commit("update_autocomplete_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_samples",resp.data.records)
}
} catch(e) {
context.commit("update_autocomplete_status",3)
}
},
async save(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
var msg = ''
if(prm.status === 'N')
msg = "Pemeriksaan "+prm.T_TestName+" batal dipilih"
else{
msg = "Pemeriksaan "+prm.T_TestName+" berhasil dipilih"
}
context.commit("samplesend/update_msg_snackbar",msg,{root:true})
context.commit("samplesend/update_alert_success",true,{root:true})
setInterval(function(){ context.commit("samplesend/update_alert_success",false,{root:true}) }, 5000)
context.dispatch("search",prm.paramsearch)
context.commit("update_in_saving",false)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async doaddtest(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.doaddtest(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
if(data.records === 0 || data.records === '0'){
var msg = "Data pemeriksaan berhasil disisipkan ..."
context.commit("update_msg_success", msg)
context.commit("update_dialog_success", true)
//context.commit("update_dialognew", false)
context.dispatch("samplestoragesas/search",prm.paramsearch,{root:true})
}
else{
var msg = "Sudah ada dong, pemeriksaan yang sama dikeluarga ini"
context.commit("update_msg_info", msg)
context.commit("update_open_dialog_info", true)
}
}
} catch(e) {
context.commit("update_save_status",3)
}
},
}
}

View File

@@ -0,0 +1,31 @@
// State
// data ...
// Mutations
//
//
// Actions
import samplecall from "./modules/samplecall.js";
import samplesend from "./modules/samplesend.js";
import samplestorage from "./modules/samplestorage.js";
import system from "../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
samplecall: samplecall,
samplesend:samplesend,
samplestorage:samplestorage,
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)
}
}
});